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.
- 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.
- Import this database to the empty database in the hosting account.
- Upload the local WordPress site to the hosting account - I usually use FTP.
- 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.