April 6, 2021
This is a companion blog to my previous The Changing of the URL blog post. I’ll be covering the scenario where you’re moving a site that you’ve developed in some hidden corner and now it’s ready for its public debut.
Ideally, you’ll have a hosting package that has plenty of space and allows you more than one database so if anything goes terribly wrong you’ll be able quickly and easily to back out.
Prestashop 1.7 Series
The basic steps are these:
- Put both sites under maintenance
- Rename the web directory to something like “new_site”
- Zip, Tar or otherwise bundle up the web directory of the development site
- Copy the zipped development site to the production server and unzip it so it appears in the base directory as new_site
- Dump the development site database
- Create a new database and database user on the production site.
- Import the development database to the new production database
- Assuming you have phpAdmin follow these steps:
Create a query
SELECT * FROM `ps_configuration` WHERE name like '%PS_SHOP_DOMAIN%'
You should get two results, one plain and one for SSL. Change the value field(s) to your testing URL.
- While you’re there check out any results from this query:
SELECT * FROM `ps_configuration` WHERE name like '%your.dev.domain%'
(obviously use your real dev domain there!) Change any instances of your.dev.domain to your.production.domain.
- Now navigate to the imported dev site and edit
/app/config/parameters.phpand change those settings to the new database and user that you created when you imported the data from the dev site.
- Take a deep breath - we’re almost there!
- Using the file manager go to the
/var/cache directoryof the new site and empty out both the prod amd (if it exists) the dev directory.
- In the root directory of your hosting account rename public_html to something like “old_site”. Rename “new_site” to public_html.
- Use your browser to visit your website. If all’s well you should see the “Site under maintenance” for the new website.
- Log in to your admin (of the new site) check that your IP is enabled in the maintenance section so you’ll be able to give the site a good going over before it’s taken out of maintenance and the public are allowed to see it. Always a good idea to go to Advanced Parameters and clear the cache there.
- When you’re satisfied that everything is working as it should, take the site out of maintenance and congratulate yourself on a job well done!
If all that sounds like a nightmare then why not contact me for fast, friendly and surprisingly affordable migration assistance.