I work on wordpress sites with a wordpress multisite install. Now I’m switching from developing on the live server, to working with a staging server and then pushing to the live server when everything is done.
Now of course the database would have to be migrated and updated for each environment in some way (probably both ways; pulled to staging for starting and pushed to live for deployment). But also the themes, templates and assets would have to be migrated.
Since I’m new to this, I don’t know exactly how this is usually done. I’m looking for a safe and practical solution. I’ve looked into using grunt (which I already use for other tasks) with grunt-wordpress-deploy for example, but it doesn’t seem to be doing everything I want to do.
So my question is: how do I do this? How do I safely and easily synchronize a wordpress subsite between my staging and my live server?
Go to network admin and find the ID of site you want to move ( In the examples below â 17 )
Now you would want to transfer the whole
wp-content folder -> uploads -> Sites -> site_id
( in this casewp-content folder -> uploads -> Sites -> 17
, of course you need to have wp on new server – see addendum )In to the original site on the network, check what theme it uses . FTP to the main site
wp-content folder -> Themes
and download/ transfer the theme it uses . ( or see below addendum )Do the same for plugins , go to the original site dashboard, see what plugins it uses . Do not forget to also check what plugins are activated
NETWORK WIDE
andmu-plugins
and transfer those too . For compatibility reasons , I always prefer to transfer the ones I used before and not to download from the wp repository . updates can and will be made later . for now , it is better to keep all the versions the same as original .Export / Import DB ( using PhpMyAdmin for example ) and then rename the tables :
( note the last two – those are tables from the MAIN network DB – not site specific )
like so :
DONE – After that – Your new site should be fine .
However – some residues might be there ( due to specific plugins / themes ) , so search/replace for
originalname.com
orwww.originalname.com
orsites/17
could also be made ..This process, when understood – can easily be adapted ( reversed ) to transfer also the other way around ( from single to multi )
Addendum
If you have a LARGE site with a lot of content ( e.g. images ) – FTP might take too long .
It would be much faster to do that on the server directly, so I am just adding it here .
uploads/site_id
(17 – remember ? )folder
( or other SSH on your new location )
then
wget -m http://www.old-multi-domain-path/wp-content/uploads/sites/site-id.tar
( or zip, or rar etc ⦠)
you will probably get the file at a folder called
www.old-multi-domain-path/wp-content/uploads/sites/site_id.tar
now , move it to root, and delete the folder
rm -rf www.old-multi-domain-path/
wget http://wordpress.org/latest.tar.gz
Now go back up to Phase
3.