duplicating modx revo install - modx

I'd like to do some changes to a modx revo install through a staging subdomain, with a separate database. What's the easiest way of doing this? I've been battling with this for two days.
I'm trying a new install now and replacing content, components and database content

I end up moving/duplicating MODX sites between live and staging subdomains several times per week. Here's how I do it.
MySQL
Create a new blank staging database
Make sure you MySQL user can access the new databse
Export/Backup your live database
Import the backup to your new/staging database
Files
Download the matching version of MODX from http://modx.com/download/previous-releases/ because you'll need the /setup/ directory (hopefully you didn't leave that on your server previously).
Copy the entire content of the 'public_html or 'www' folder over to the staging subdomain folder. Don't forget the .htaccess file which is sometimes hidden.
Upload the setup folder to your staging location on your server just like it would be found in a clean MODX install.
Update the three config.core.php files from the top directory, /connectors/, and /manager/ to update the "MODX_CORE_PATH" to the correct directory for staging.
Update the 'core/config/config.inc.php' file. You'll need to update the database details and every instance of your directory structure to match the new staging location.
Run Setup
Run by going to staging.domain.com/setup
If you get ant errors during setup it probably means that you missed something that needed updating in one of the inc.php files.
It's actually very similar to moving the site from one server to another except duplicating to a subdomain on the same server instead. MODX has instructions for moving to a new server at http://rtfm.modx.com/revolution/2.x/administering-your-site/moving-your-site-to-a-new-server

There is another method to solve this problem.
Create new database & user for your sub site.
There is nice github repo. There you can find MODX install script which runs via cli. You'll get a new installed version of MODX in the end.
Install Vapor package from official repo to your old site. Then run vapor script from it via cli. It creates a new package with your whole site dump (You should check dependencies for xpdo objects in this script. For ex. you can copy all the stuff except users or anything else).
After all copy new package to core/packages at new site and install it.
Dump is ready :)

Related

how to backup Joomla website when developing on MAMP?

I am a new web developer. I have been using Joomla with a 3rd party template, developing it on a local MAMP server. The template is sort of unstable and breaks easily. I would like to Backup my work on a daily basis.
I'm assuming all the files and the database need to be backed-up? Is there a best practice for this?
Thanks very much!
Using Akeeba Backup (https://www.akeebabackup.com/products/akeeba-backup.html) is indeed a good idea. You can schedule a command line task to run every day and create a backup of this site. To restore such a backup you can use Akeeba Kickstart (https://www.akeebabackup.com/products/akeeba-kickstart.html). Very easy, very comfortable.
But this only works if you don't break your Joomla! installation! Your question implies something like this. To do a manual backup you can simply zip the folder which contains your Joomla installation and create a database dump. You can do both every day using command line script.
Creating the dump: https://dev.mysql.com/doc/refman/5.7/en/mysqldump-sql-format.html
Using GIT might work as well. Instead of zipping your folder you simply commit it to your git repository. Don't forget to add the database dump to your repo as well.
https://techjoomla.com/developers-blogs/joomla-development/deploying-joomla-projects-using-git.html
http://joomlaablog.blogspot.de/2010/11/how-to-track-your-joomla-project-with.html
The best and easy method is to get it done through Akeeba Backup https://www.akeebabackup.com/download.html. Install this component at the backend. Run it and take a backup whenever you want. It takes backup of files and database both. You can even download and extract it to run it in another web server. To extract Akeeba you can use their software Akeeba Extract. This is all free.

Magento 1.7 - Two magento in one server are effecting each other

I have 2 magento files in one server(linux) , one is live and other one is for testing. Both have different url. The testing magento is just setup by coping the live files and database. But I found out the testing magento will effect the live magento (for example I plugin the new template into testing magento , the live magento css and desgin will run also). Any idea about it?
Make sure that you have updated the URL in all of the config files AND the database. The easiest way to do this is to dump the database of the new site, find and replace the url of the original install with the new one then re-import it.
If you've been consistent with not hard coding links or images in CMS pages then the URL should only appear in these places:
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/update_site_url_in_core_config_data
You should use one magento on one server. Just create multiple stores in one. and redirect each store you what you want. www.example.com -> store 1; www.example1.com -> store 2 and so on. Magento works faster if you do that way. i have experience with multiple magento on one server. after more people start to use your store then server will start to lag or magento will start to work a lot slower.
this is happening because you have copied the database and files due to which in local.xml and in database table core_config there is information related to your live files, instead you should setup again the TESTING copy, just follow this steps.
take the backup of file local.xml from location /app/etc and after backup delete this file
Now after doing that just access the testing domain, now your setup for testing copy will start.
this will create new configuration information for testing copy

Trying to move Drupal install TO subdirectory

Okay, so I've searched everywhere and while I can find plenty of stuff about moving a Drupal install out of a subdirectory I can't find anything on moving one into a subdirectory. I've recently taken over this project and it was developed without me so I've been landed in it here.
The problem is that the site was developed in the root of a dev server and I now have someone who wants it in a subdir. I've changed the base url in the htaccess and I've tried manually changing references in the CSS and DB but I can't be sure I've caught everything (modules etc).
What I want to know is, is there a way to force every link relative to the root to be relative to root/example instead. Basically everything that was once at www.example.com is now at www.example.com/subdirectory.
Thanks.
There's two pieces to this. The first you've already done: configuring htaccess to set a base url that includes the subdirectory.
Unfortunately, you may have quite a few references in the node content (especially embedded images) that will stop working.
A relatively simple solution to this would be to include a <base href="foo.com/dir" /> tag in your site theme, but this isn't a great fix in the long term.
You can try modifying your database directly, through queries such as the following (use with care, backup your database ahead of time, etc):
UPDATE field_revision_body SET body_value = REPLACE(body_value, 'devdomain.com', 'proddomain.com/subdir') (add http:// into those queries)
You may also need to update the paths in your files table to reflect the new locations on disk, especially if you're using multisite.
Alternately, have you considered using the Backup & Migrate module to move content from the dev server to a new install at the new instance?

How to copy Drupal website to localhost from Server

I have to update, add and fix a drupal website.
The website is on a live working server and i have full access to everything.
Drupal version is: Drupal 6.22, 2011-05-25
I want to make a copy on my machine (win7+iis+(any php needed)) to be able to change and test my updates without touching the server.
I already copied the project folder and i found the database file.
The Database is odb file.
Download whole database. You can use drush or Backup_migrate. Then setup a fresh drupal system and inject the whole database there.
As I fortunately never used Windows, unfortunately I can't give you OS specific details. But xampp or similar solutions are there.
Get the backup of your project files folder and databse from c panel or from the server folders and SQL command prompt
Then install wamp or xampp in your local system place project folder in c:/wamp/www folder and create a database in phpMyAdmin and import database with db backup file.
Then run your project as localhost/YouProjectFolder in browser
config the default.ini the site folder and you all set

Transfer Resources to fresh installation

I have live website running on MODx Revolution 2.1.3pl. Some days back I had to restore my entire site from backup. This messed up some file ownerships (for packages installed and images uploaded etc.) because in my server PHP runs as 'nobody' user which is different from my cPanel user.
Now I can't change much things on the server(like installing suPHP because its a shared server) and I don't know which all files are created by PHP, I decided to wipe the site clean and perform a clean install. My site has a large number of already published resources which is impossible to be posted into the new site individually.
Is there any way that I can transfer those resources to the new installation?
Why don't you create a mysql dump of your old site (with phpmyadmin or the like) and import this into a new database, which you use to run your new site from?
I've not tried it myself but provisioner seems to do (or at least claim to) what you need.

Resources