Transferring site from one Aegir server to another

Events happening in the community are now at Drupal community events on www.drupal.org.
aaront's picture

I have spent quite a while trying to make the above happen and just succeeded, so I thought I'd share in case anyone else needs to do so. I'm not an expert on these things so I'm sure I've wasted some time here -- suggestions welcome. One optional part here (necessary in my case) is I'm using the patches at http://drupal.org/node/537016 to make ssl happen, and Secure Pages/Hijack Prevention to do all that fun http>https>http stuff. That means you can probably skip steps 1, 2, and 18-21. We'll call the first server "aegir1" and second one "aegir2"

*1. disable secure pages in the secure pages admin screen, then disable the secure pages/hijack prevention modules
*2. turn off the site's ssl options on aegir1 - site will be re-verified
3. backup site in aegir1
4. go to drupal folder on aegir1 server. tar -zcvf the contents of sites/(nameofsite) as well as sites/all if you want to get your platforms in sync
5. on aegir2, create a new site on a platform with the same version of drupal as the site was on in aegir1. give the site the same name that the site had on aegir1
6. on aegir2, go to the platform's sites folder and sftp the compressed files from aegir1, including the backup from /var/aegir/backups
7. if you moved sites/all over, decompress it, then make sure permissions are correct. If you do this, you'll probably want to verify the platform afterwards.
8. delete contents of the (nameofsite) folder, move (nameofsite).tar.gz into (nameofsite) folder and tar -zxvf it, then make sure permissions are correct
9. look in the site's _80 file in /var/aegir/config/vhost.d/ to find out the database name, or just look at the node number in the aegir web interface.
10. log in to mysql and drop the database you found in step 9
11. create a new empty database with the name of the one you just deleted
12. decompress the database backup, which gives you database.sql
13. import database.sql into your new database - /usr/bin/mysql -u root -p -h localhost (nameofdatabase) < database.sql
14. restart apache - sudo /usr/sbin/apache2ctl graceful
15. back in the web interface (aegir2), verify the site. this should come out green.
16. change dns alias for the site from the old server to the new one.
17. go to site - it should function just fine, I've read you need to clear the cache and maybe check imagecache (though I didn't and it seemed fine)
*18. enable ssl options for the site in aegir2 - it will reverify
*19. comment out secure cookie line in the site's _443 file (necessary for secure pages)
*20. restart apache again
*21. enable Secure Pages and Secure Pages Hijack Prevention
22. yell "hooray!"

Hope this helps someone. Again, skip * steps unless you're running aegir with the ssl patch mentioned above and secure pages.

Comments

Note about moving files over

aaront's picture

Note about moving files over - didn't realize aegir was backing up all associated files when it backs up the database, so you just need to move over that backup. cool!

And also, this is on .4alpha7 on ubuntu

Aegir hosting system

Group organizers

Group categories

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: