Using localhost to develop client's website

Hi,

I am completely new to Wordpress & CMS as well. I did some web design before, but that was not much to start freelancing. Now I want to start freelancing with Wordpress.
For this, I have set up a localhost using XAMPP. Well, everything is going fine. But as you know, Wordpress needs a database to work. So, when I am finished with my website, how am I going it to deliver to a client? I don’t see any database related files in the respective Wordpress folder.

Previously, I designed my website using HTML CSS then I uploaded the files with FTP. But while using Wordpress, I may upload all the wordpress files as well as my edited files, but what about the Database? If I create a new databse in the domain where I am going to upload the files, I think all my changes will be lost because it would be a completely new databse.

Please clarify, my questions are silly I know, but as you can see, I am a noob on this side.

If you use XAMPP, then you also have PhpMyAdmin. Use that program to export your database and save it to your desktop.

Open the database file in your text editor and do a search and replace to change all the localhost/sitefolder URLs to your live URL.

Create a new database in your live website server and import the database file that you have on your desktop.

In your live WP files, change the database name, username, hostname and password in the config.php file to match the setup of your live database.

3 Likes

The wp-config.php file does not come built-in with WordPress. It’s generated specifically for your site during the installation process.

No, it is there from the start in the root - called config-sample.php. You can go in to the file, edit the appropriate places, then save it as config.php.

There are several tutorials online about moving the developed Wordpress site form XAMPP to the client server.
You can use a WP plugin. E.g:

Or you can do it manually. E.g:

http://www.wpexplorer.com/wordpress-local-to-live/

Regardless of what method you use, I would recommend that you have a dedicated dev machine, or a dev virtual machine on it, and edit the machine’s host file (its virtual host section) to point the client’s domain to the nachine’s XAMPP server. (Then all requests for the client’s WP site from your dev machine will go to your local WP site.)

That could also save you from search and replace all absolute URLs in the exported database.

Edit the “host” file: http://nurelm.com/setting-up-a-virtual-host-with-xampp/

2 Likes

Usually, when I do a small site I don’t really make the whole dev machine. I start XAMPP install WordPress there and when I’m done I use the plugin Duplicator it makes it quite easy to move the site to a different server.

Now, if the site is going to be on development for a long time and such, then definitely setting up a dev machine/environment is way more safe.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.