Create a staging site on cPanel for Magento
Posted by Will Kruss on 20 February 2021 05:09 PM
|
|
Create Staging Sub DomainThe first thing we want to do is setup a sub domain for our staging store:
Create Staging DatabaseWhile we're still in cPanel, let's setup a blank database for our staging store:
Copy Production StoreNow that our sub domain and database has been setup, we need to copy our production store over to the sub domain directory.
For the next step, you'll need to know the database information for the production store. If you don't remember this, open up the following file:
Lines 43-46 will contain your hostname, username, password, and database name. Next, we need to copy the data from the production database over to our staging database. We'll be doing this from SSH as well.
You'll be prompted to enter the password for the user that has privileges to the production database, so type that in and hit the Enter key. This can take a couple seconds to a couple minutes depending on the size of your database, so just wait until it finishes. Once it finishes, we need to import this data to our staging database:
Just like before, you'll be prompted to enter a password, but this time it will be for the user who has privileges for the staging database. Update ConfigurationUsing your favorite text editor, open up the following file from the
Replace the values for lines 44-46 with the database details for our staging database. Now we need to do is update the Unsecure and Secure URL for our staging store:
After You UpgradeCheck you can reach the store at the new subdomain e.g. staging.yourdomain.com | |
|