This walkthrough is provided as a general guide for setting up a local WordPress install for testing or staging and requires you to have some knowledge of WordPress or general technical background. Please note that you do not have access to PHPMyAdmin on Envato Hosted, so will only be able to transfer changes made on your local install to the live server using a WordPress plugin solution.
If you have done this before, the below steps provide a quick checklist of things you'll need to copy your site to your local server.
- Install a local server (MAMP for Mac or XAMPP/WAMP for PC) and ensure it is running PHP 5.6 or later.
- Create a new database (optional - only needed if using a plugin to import database tables)
- Download WordPress from wordpress.org, unzip and copy the contents of the wordpress folder to the root of your local site inside htdocs
- Download the wp-content folder and wp-config.php files from your live server and copy to the local site
- Download a backup of the live database from your Backups tab in the Envato Hosted dashboard or using a database backup tool in WordPress.
- Import the database via PHPMyAdmin
Copying Live Site to Local
Install a Local Server
- Download MAMP 4 (Mac) or MAMP 3(PC) from www.mamp.info for your operating system.
- Double click on the file MAMP_MAMP_PRO in your Downloads folder (mac) or where you downloaded it (PC).
- The System Installer will guide you through the installation process.
- Note: You need administrator permissions to install MAMP!
- Launch MAMP and click on Preferences. Continue with First Steps to setup and configure the server.
- On the PHP tab of the preferences window, select PHP 5.6.x (you CAN install PHP 7 for testing, but note it is not yet enabled on your live site)
- On the Web Server tab, select Apache and click OK
Create a New Database on Local Server
- With MAMP running, click the Open Start Page icon. This will open the main page of your server in a browser window.
- Now click on Tools > phpMyAdmin.
- To create a new database, click New, give it a name and click Create
Create a New Database User
- Click that database on the left and click the Privileges tab
- Click Add user account
- Enter a username (not "admin"), select Local for Host name and enter a strong password
- Check Grant all privileges on wildcard if you want to use this user on other installs
- Check the Check All box for Global privileges
- Click OK at the far bottom right of the screen.
Backup Your Live Database & Import
- Backup your live site database using any database backup plugin, or access your automated backups on your Envato Hosted dashboard.
- If using a daily backup, unzip it to find the zipped database export
- You can use a zipped file or the full .sql file
- Return to your PHPMyAdmin screen
- Click Import at the top
- Click Choose File/ Browse and locate the zipped database file (or .sql file) and click Open
- Click Go to begin the import.
- Go to wordpress.org and download the latest build of WordPress and unzip it.
- Copy the contents of the wordpress folder
- Navigate to the htdocs folder inside MAMP and paste the WordPress files into the root
Download & Copy Live Site Files
- Login to your live site via FTP and download the entire wp-content folder and the wp-config.php file located in the root
- Either download them directly to your htdocs root to overwrite the existing, or copy them from the download location into the htdocs folder of your MAMP install and overwrite when prompted.
- Open the wp-config.php file in a plain-text or code editing program (this is important - don't open or save this file using Word or similar)
- Replace the database name, username and password with the values you created in the last section.
- Be careful not to remove the single quotes around each value!
- DB_HOST should be localhost
Login to WordPress
Open localhost/wp-admin in your browser and login using your existing username and password.