If you want to create a website, the best way is to start developing the site on your local PC server and save money on the hosting during the development phase. Once you are finished with the development of the site, you can then move your site over to a live server. In this article we will explain how you can do this.
- WordPress Site on a local server like, WAMP or MAMP with full access, i.e to the database and all the files of the site.
- Web Hosting that supports WordPress Sites and provides FTP access to the site.
- Database Manager like, Adminer or PHPMyAdmin and knowledge of how to use it. We would be using Adminer for the screenshot examples for this article.
- FTP Client like FileZilla.
- Note down where on the site absolute paths are used. These would later be needed to change to the live server specific path.
Move local WordPress Site to Server
Step 1 : Export the local WordPress Database
- Open ‘Adminer‘ and select the WordPress Database.
- Export and save the database as a CSV or SQL file.
Step 2: Correct URL paths
- Open the exported database file in any text editor that has a ‘search and replace‘ feature.
- Run a search and replace on the database file and replace the local url with that of your domain.
Edit : This step might break any serialized data for a plugin. To avoid any such problem we suggest using one of the many ‘Search and Replace’ plugins available.
Step 3 : Upload WordPress files to server
- Using a FTP client access your hosting server and search for a directory named ‘public_html‘ or ‘www‘ (name may vary depending on your hosting company).
- Copy all your WordPress files from local website directory to the live server website directory.
Step 4 : Import the Database file to the server
- Open the Site Database on your server using ‘Adminer‘. If the server does not have a database already for the new site, you will have to create one.
- Select the Database and press “Import” button placed on the left sidebar for ‘Adminer’.
- Upload the SQL/CSV file of the local site to the Server database.
Step 5 : Edit ‘wp-config.php’
- Using a FTP client again open the ‘wp-config.php’ file from the site files you transferred to the server.
- In this file you have to edit the following 3 lines :
That’s all, hopefully your live site will now be up and running. Check your site to make sure that every thing is working fine as expected.