For various reasons you have decided to change hosting for your Magento website. Among the many variables that come into play when migrating a Magento website, one of the most important ones is choosing a host that specializes in Magento hosting. Nexcess for example is one of the best Magento hosting companies and they provide a great deal of assistance with website migrations.
Once you have chosen a company you then need to decide how to migrate. There are two ways to migrate a Magento website. The first method is to shut down the store while the migration takes place. This prevents changes to the database or someone placing an order that will not be transferred over to the new server. The second way is to migrate during a slow period for your store, for example in the middle of the night and then sync the order database. In this case, you will continue to take on orders, and then when you are sure everything is set up correctly you will change the DNS records to point to the new store and not loose any orders. This checklist is meant for someone that is following the latter approach, although, most steps will still apply.
Website Migration Checklist
1) The first task is having your new server setup and secured. This includes the web server, PHP, and MySQL server. You’ll probably even want to install phpMyAdmin if it doesn’t come with your hosting package. Make a domain “dev.yoursite.com” to use as a staging environment.
2) In your current store, disable the cache and re-index. Disable compilation mode if it’s enabled.
3) (Optional) For those who want to shut down the store during migration – put the store into Maintence Mode. Not only does this prevent new orders from being placed, but it also prevents changes to the database from say an API.
4) Login to your store’s server and go to the web root and type the following commands
rm -rf var/cache/*
rm -rf var/session/*
rm -rf var/report/*
rm -rf var/log/*
Backup your database, and code. You can do this from SSH via:
tar -zcvf www_root.tar.gz www
mysqldump -u [magento_user] -p [magento_database] > magento_database.sql
You will be prompted for your MySQL password.
Be sure to copy both the www_root.tar.gz and magento_database.sql to your local computer via FTP. Now would also be a good time to backup this data on say a USB stick or external hard drive.
5) Are you planning to upgrade your store or get rid of extensions you don’t use anymore? Now would be a good time to figure that out and make a list.
6) Regardless, the next step is the most crucial. Unpack the www_root to your new server’s www/ directory. Import your magento_database.sql backup. Your site’s essentially been cloned to a new server. You’ll have to change the base url path – using MySQL from the command line run the following… assuming you’re not going to be changing the DNS right away:
SELECT * FROM core_config_data WHERE path LIKE ‘%base%url%’;
UPDATE core_config_data SET value = ‘https://dev.yoursite.com’ WHERE path = ‘web/unsecure/base_url’;
UPDATE core_config_data SET value = ‘https://dev.yoursite.com’ WHERE path = ‘web/secure/base_url’;
You should now be able to properly access your store and admin area. The only other thing you have to make sure is correct is that the new database credentials are set in app/etc/local.xml
7) Check to make sure that all the features and settings are still working. Do orders process? Do all of the frontend features work? What isn’t working? Make a list and resolve them.
8) After resolving any issues from the previous step, now is the time to go through and uninstall or remove any modules that you no longer plan to use on the new site. Repeat step 7 after this is done.
8.Optional) Upgrade to a new version of Magento and Repeat step 7 – again.
9) After confirming that you have everything copied over and in perfect working condition to a new server, you’ll want to change your DNS A record to point to the new servers IP address. It’s best to do this when your store has the lowest amount of traffic or when the store has the lowest number of purchases to ensure the least amount of impact. At that point, you’ll also want to go into the Magento admin on the new server and change the base path URLs as mentioned earlier from “dev.yoursite.com to yoursite.com”.
10) Ensuring that everything is working correctly and there are no bugs or glitches, you’re now safe to shutdown the old Magento store. I recommend leaving it up, restricted by IP access, for at least a week or two until you’re positive that the migration was a success. In a worst case scenario, you could always revert the DNS A Record back to the old server and still have your site up and running.
One of the biggest things to consider when moving your Magento store is how much downtime you will face. Downtime with a transition is almost unavoidable. This is in large part due to DNS needing to propagate. However, by having everything set up, and confirming that the store has been correctly transferred, you will have in large part left the only downtime to the amount of time it takes for the DNS to propagate.
1) Did you forget to remove var/cache?
2) Did you forget to check file and directory permissions?
3) Did you forget to change the base path of your Magento URL?
4) Did you make sure to change app/etc/local.xml with the correct database credentials?
5) Did you forget to white-list new IP address(es) for third-party services
Tips For Choosing a Webhost:
- If you are running a Magento Store, it is 100% not advisable to have your site hosted on a shared account. There are many reasons for this, but the top three are:
- Amount of control over the server
- Choose a host that will allow you to grow. You might not need a CDN right now, but if your store really takes off that might become a necessity to keep load times down. It goes beyond CDN’s and hardware, what kind of support will your host provide? Does the host automatically backup the server for you?
- Is the host familiar with Magento? Hosts like Nexcess are geared specifically towards working with Magento. However, typically, other hosts are not going to know what they are doing when it comes to hosting a Magento store. I have first hand experience in the difference of the type of support and security protection one will get when working with a host geared towards Magento and one that is not.
- Before you decide to go with a host, type into google “company review”. For example, you will see many positive reviews for Nexcess if you search “Nexcess review”. There are a few other companies, that will not be named that have numerous complaints regarding their service.
- Do you need PCI compliance? If you accept credit cards, you need to be PCI compliant. The level of PCI compliance, if you are storing credit cards, is something else to consider.
To summarize, consider the following when choosing a new host:
- Traffic needs (ie. bandwith, clustered servers, resource usage)
- Ability to upgrade server in the future
- Support provided
- Backups and security measures
- Reliability (server uptime)
- Hosting environment – Is the place the server is located protected by security access controls? Does it have power generators? Does it have fire suppression systems? What kind of backup redundancy is present?
- What are other people saying about this host?
Contact us today if you need help migrating your Magento website.