LocalHost wordpressSite to liveHost using directadmin

Hello!

I want to move my wordpress site from localhost to live host. I am using xamp as a local host and DirectAdmin as a live host. Could anyone give me some tutorial or manual, how I can do it by using DirecAdmin, because I tried a dozen methods and watched different tutorials, but none of them helped. Thanks for helping me out.

Have you set up the database on your live host and installed WP?

Yes, I installed wordpress and set up mysql database and user, and then I donā€™t know what Iā€™m doing wrong, that it doesnā€™t work.

I donā€™t know DirectAdmin and whether or not it can help, but there is a Duplicator WP add-in that can help transfer a WP site.

I donā€™t know if you want to try this, but I always move my WordPress sites by hand. Here are the steps I go through, after the empty database is set up where the live site will be hosted.

  1. Make a backup of your local database, and do a search and replace to change all instances of ā€˜localhost/yourdirectoryā€™ to the URL of the live site.
  2. Import this database to the empty database in the hosting account.
  3. Upload the local WordPress site to the hosting account - I usually use FTP.
  4. Change the credentials in your live config.php file to match your new database

If what you are trying isnā€™t working, try this method.

Well the general approach would be:

  • Copy the entire content of your local wordpress folder to your serverā€™s http-directory
  • Edit the wp-config.php and adjust the database credentials
  • Export the entire wordpress database and import it to the serverā€™s database
  • In the wp_options table, change home and siteurl to the new server URL
  • Go to the WP admin panel on the server, and under settings ā†’ permalinks just click ā€œsaveā€ (this will re-generate the .htaccess file if necessary)

Although as @Gandalf said, there are plugins to simplify the process. This one comes pre-installed with the Bitnami XAMPP wordpress-plugin, for instance, so it might be worth a try.

x-post ^^

1 Like

Ok thanks for manual guys,but Iā€™ve done it now two times, and everytime it shows me this:
Error establishing a database connection

When I check the file wp-config.php with the data of database MySQL in my directadmin account, itā€™s correct. Any idea?

If the credentials are correct, make sure the database user (as specified in the wp-config.php) has the required permissions for this database. Iā€™m not familiar with direct admin either, but in phpMyAdmin you can create a new user (e.g. ā€œwordpressā€) and simultaneously a new database for that user, where s/he has all permissions by defaultā€¦ then youā€™d just need to import the wordpress dump there.

What you might also try is putting a fresh WP install on the server, and just copy your wp-content folder there. Then youā€™ll be asked for the db credentials when you first visit the site, and WP will adjust the db to the new installā€¦ this usually works pretty well IME.

Ok, I am stuck in here:

my http://localhost/.../ is active
my real host http://ā€¦pl is different. I deleted all the database there, and copied a new database from localhost to public.html. So basically it should start off, right? but it has not. It shows me black old wordpress theme, any ideas for this ?

How exactly did you copy the database?

Did you do a search and replace in your old database like I suggested earlier? You need to change all instances of ā€˜localhostā€™ to your new URL.

To start off with, go to the database table wp_options and change the URLs for the following: siteurl and home. Those two fields are the first ones in the table.

I copied a database in filezilla from localhost (htcdos) to my serwer public_html(exchanging all files)

There is no such directoy as wp_options. Where Can I find it? I have replaced only database and user for my live server.

Not a directory, a table in the database. Do you have phpmyadmin capabilities in your hosting account?

What sort of database do you have? Databases usually live on a database server, and cannot be copied the way you copy files and directories.

Oh right, I found it, but first two are set good. They are the same as my normal domain name, not a local host name.

Did you replace all the other instances of ā€˜localhostā€™ with your URL in the database before you imported it?

Hmm, just normal database as wp-admin, wp-content, wp-includes an so on.

No, i havenā€™t replaced anything, just the database of mysql. Where are the files, that I should replace the hosturl?

I donā€™t understand your last comment. wp-content, wp-admin, wp-includes are directories in your website. They are not the same as the database.

When you export your database from your localhost site, you should save it on your desktop and open it up in a text editor such as NotePad++. Then use the text editor to find all the ā€˜localhostā€™ instances and replace them with your site URL. Then import the database to your hosting account.