How to create Magento 2 dev sites

    October 17, 2019

    How Nexcess clients on physical (non-cloud) clients can create Magento 2 development (dev) sites.

    What you need

    • A working, preferably current installation of Magento 2

    • A Nexcess account on a physical (non-cloud) account and access to SiteWorx; If you use Nexcess Cloud, see instead What are Nexcess Cloud dev sites? for details regarding dev site creation

    • MySQL or phpMyAdmin (via SiteWorx)

    • SSH (recommended), FileZilla, or a similar file-transfer utility

    Method

    ATTENTION: This method is intended only for Nexcess Classic (non-Cloud) clients. If you use Nexcess Cloud, see instead What are Nexcess Cloud dev sites? for details about dev site creation.

    1. Create the secondary domain to serve as the dev site. For details, refer to How to add secondary domains with SiteWorx.

    2. Using SSH, FileZilla, or a similar file-transfer program, copy your website files from your Magento 2 installation to your new secondary domain. SSH is the preferred method, as FTP may take considerable time to copy these files. See How to set up FileZilla and How to use FileZilla for more information.

    3. Download your live website’s database as a .sql file to your computer. If you are proficient with the command line interface and MySQL, see How to export tables and import MySQL tables via CLI/SSH. If not, use the method provided in How to import and export MySQL databases in SiteWorx.

    4. Create a new MySQL database, a new user, and to assign that new user to the new database. Refer to How to create MySQL databases and users with SiteWorx for more information.

    5. Open this new database in PHPMyAdmin, then import the downloaded .sql file to the dev site database. As in Step 3, see How to export tables and import MySQL tables via CLI/SSH or How to import and export MySQL databases in SiteWorx for guidance.

    6. Change the base URL by opening your newly imported database in PhpMyAdmin, or by accessing via CLI. In the core_config_data table, update the web/unsecure/base_url, web/secure/base_url, and design/head/includes entries with the URL of your dev site. See How to change base URLs in Magento 2 for more information.

    7. Verify you have updated all URLs searching for %<your_domain.com>% and update as necessary.

    8. Using a text editor, modify the env.php file (under app/etc/env.php) to reflect the new db name, username, and password you created in Step 4.
    9. Flush your cache. If using Magento, see How to flush your Magento cache for assistance.
       

    For 24-hour assistance any day of the year, contact our support team by email or through your Client Portal.

    Was this article helpful?

    Send feedback

    Can’t find what you’re looking for?

    Our award-winning customer care team is here for you.

    Contact Support