Migrating Your Existing Site to PANTHEON

Greg Coit's picture

So long as you are following best practices, migrating an existing Drupal site onto PANTHEON is not very difficult. This page will walk you through the steps you need to take to deploy an existing site onto the base installation. If you are interested in deploying from version control, please see deploying from VCS with PANTHEON.

First Things First

This documentation assumes that you haven't hacked core. :)

If you haven't already, you might also want to change the root mysql password at this time. Instructions for that are in the README.txt on your server.

Next you'll need to scp (or use an sftp client like Transmit, Filezilla, or the like) a mysql export (dump) of your existing site, and the contents of your files directory as well as any contributed/custom modules and themes you run, onto the server. You should load the dump over the top of the pressflow database (including updated credentials as needed):

mysql -u root -p pantheon < my_site_dump.sql

Then place your contrib modules in /var/www/pressflow/sites/all/modules and themes in sites/all/themes, like so:

cp -R my_site_modules/* /var/www/pressflow/sites/all/modules/
cp -R my_site_themes/* /var/www/pressflow/sites/all/themes/

Lastly, place the files directory wherever your Drupal application expects it, which should probably be in sites/something/files. Then reset the ownership of this directory so Apache can continue to maintain it. Assuming the location you expect is sites/all/files:

chown -R www-data /var/www/pressflow/sites/all/files

If you did not previously have the ApacheSolr and Varnish modules enabled, you will need to enable them, and configure the ApacheSolr module to use the "default" search database.

You should also confirm that the paths specified under admin/settings/file-system are valid and writeable by the www-data user. If not, you'll see a warning on that page.

The last bit of configuration is to log in, go to admin/settings/performance, and set caching to external, define a max page age, and be sure that page compression is off. This will allow Varnish to start picking up whole pages for your logged-out users, as well as letting the lower-level mod_deflate do the work of compressing your pages for transport.

Comments

Project Mercury 1.1 (Beta) on Ubuntu Lu

protoplasm's picture

These same instructions worked well for Mercury 1.1 beta--as did your Step-by-step--which really was amazingly simple. I will add to this page that I found no pressflow (or mercury) directory at /var/www/sites for Project Mercury--so of course I had to change the path. Also, if you have libraries/plugins etc in sites/all/ those will also need to be copied over. I've just migrated an image site with too many modules to count and a lot of IO. So far, it looks like it is working almost as well as on a dedicated server. Kudos!! Keep up the good work.

using the newest 1.2 versiobn

AntiNSA's picture

using the newest 1.2 versiobn with the 64bit lucid on linode posted earlier, how can I change the site mysql password? Do I need to newfresh mercury site password and database name to match the old site database info?

I assume I do, and since settings.php is no longer used, I guess I need to change it in the sites enabled directory, under the /etc/apache2/sites-available/000_pantheon_live file ?

What I did is edited that file to put my old dadabase siet login and password and database name in. Is that correct?

<VirtualHost :8080>
        ServerAdmin webmaster@localhost
        ServerName live
        ServerAlias live.
.gotpantheon.com
       
        SetEnv db_name myolddatabasename
        SetEnv db_username myolddatabaseusername
        SetEnv db_password myolddatabasepassword
        SetEnv solr_path /pantheon_live
        SetEnv memcache_prefix pantheon_live

Now as for server Alias... IO would like to change that, but I am not sure all the files needed to be changest... like etc/hosts ??????

can I just change that to
ServerAlias live.mynewpantheonsitedomain.com ??????

re: using the newest 1.2 versiobn

Greg Coit's picture

If you just import your existing drupal database into Pantheon, there's no need to change the db_name, db_username and db_password variables.

One the drupal server: mysqldump -D database_name > db.sql

On the Pantheon server: mysql -u db_username -p db_name < db.sql (this will then ask for db_password). You may need to delete and re-create the db_name database.

Hope this helps,

Greg

--
Greg Coit
Systems Administrator
http://www.chapterthree.com

Clarification

zoon_unit's picture

Greg,

I just found this posting and have a few questions re:1.2

Before reading this thread I attempted a manual install of an existing site by loading the pressflow code over top of my site code, then created a new database to house my dump file. The site would come up after manually entering the database info into settings.php but no other page would display. (404 error on port 80) Having read your instructions, I'm now beginning to see why. So some clarification questions before I attempt your migrate instructions:

1) Should the pantheon site's install profile be run BEFORE porting my info over?

2) Since you advise adding the mysqldump over top of the pantheon database, I'm assuming there are some special tables or settings that exist within it. Is that correct? If so, how should I go about installing new databases if I'm running several different websites on this one server?