Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Move wp from localhost to server

Featured Replies

Hi,

Good day! I like to inform you that I like to move my new WP site from localhost to online server. So, I went to the online server and uploaded/backup my all files there. Then I created a new database and I tried to import my localhost database (wp.sql) there.But I got the following error massage:

“Error

SQL query:

--
-- Database: `wp`
--
CREATE DATABASE IF NOT EXISTS `wp` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

MySQL said: Documentation
#1044 - Access denied for user 'a8864920_root'@'localhost' to database 'wp'”

So, please help me to solve this problem as well. No more, I am waiting for your kind response.

Thank you.

Edited by active-worker

Have you got a database on your live server called exactly 'wp'?

 

Generally, the best thing to do is create a new database via cPanel, then export the tables from your localhost and import those, as opposed to the entire database.

 

cPanel usually prefixes databases with your username, such as a8864920_wp, not just wp.

Edited by andy9l

  • Author

Hi,

Thank you for your reply. I like to inform you that I have already created a database named "a8864920_another" in server and trying to import my localhost database there. Can you please tell me how I can successfully import my localhost database to my new created database named "a8864920_another" in server as well?

No more, I am waiting for your kind response. Be well.

Sure:

 

1. Login to phpmyadmin on your localhost

2. Go into the 'wp' database so you can see the list of tables within

3. Click on export

4. Choose 'Quick' and then hit 'Go'

5. Login to your phpmyadmin on your host

6. Go into the 'a8864920_another' database

7. Go to 'import' and choose the .sql file you exported earlier

 

That should work.

Sounds like you need to open up your sql file and remove the line that creates the table.

 

I always prefix my tables with the standard wp_

 

Never ran into issues importing the full database before, it's quicker than exporting each table. You need to do a search and replace in the sql file:

find anything beginning with http://localhost..

replace with http://yourservername...

  • Author

Hi andy9l,

Good day! I like to inform you that according to your advice I was tried to move my wp site from localhost to free online server (000 webhost) but failed.

Then for testing, I just export database (a8864920_wp.sql) from 000 webhost. Then go to the localhost phpmyadmin and created a new database named "new_site". Then import it there. And I am wondered that it worked! Now I understood that 000 webhost is not allowed to import any database in free account.

So, if you don't mind, can you please give me some free hosting sites address where allow to import any database in free account as well.

No more, I am waiting for your kind response. Thank you. Be well.

N:B: I use the same database for wp sites. I just change the table prefix their as well.

Edited by active-worker

You should be able to import a database via phpmyadmin - 000 webhost themselves say it's possible.

 

Can you post an example of your localhost .sql export? Use the [code ] tags and star **** the passwords.

Edited by andy9l

try changing this line in the exported .sql file


CREATE DATABASE IF NOT EXISTS `yoursite_wp` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `yoursite_wp`;

 

change both the yoursite_wp to whatever you've named your new database

CREATE DATABASE IF NOT EXISTS `a8864920_another` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `a8864920_another`;

 

then import

  • Author

Hi, good day! I did the following things:

 

1. Change the statement form

 

CREATE DATABASE IF NOT EXISTS `yoursite_wp` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `yoursite_wp`;

to

CREATE DATABASE IF NOT EXISTS `a8864920_another` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `a8864920_another`;

in the exported .sql file.

 

2. Then try to import it at newly created database "a8864920_another" in the 000 webhost.

3. After click on "go", I just got nothing but a blank page.

 

No more, I am waiting for your kind response. Thank you. Be well.

Edited by active-worker

I also use the 000 free servers, to upload a site I first go through all scripts and ensure there are no references to localhost. (Change any you have in the config files as well!!)

 

Then I make a tar,gz file out of the site - login to 000 account ftp pages, and upload the tar.gz.

 

There servers will (like most host's) automatically unpack everything to the directory structure it was in on your localhost, creating directories as you need them.

 

When I have a mysql db to migrate I simply make sure the export files are saved in the root of the site before I tar it down. Then I use phpMyadmin to edit the files and import them.

 

All takes about 30 mins with my slow connection and double checking myself as I go.

  • Author

Hi guys, I am very happy to say that finally I move my site from localhost to server successfully :). So, Thank you very much for all of your contributions and spending your valuable time.

 

Here is the link of my site: http://my-portfolio-site.site88.net/html2wp/

 

I not only share my site to visit, but need a little bit advice from you. Please move bottom of the page where the images (3 images but same) are not loading properly. How to show them properly as well?

 

No more, I am waiting for your kind response.

Edited by active-worker

It took a while to get your page to load, it looks good.

 

Your images are not loading because the have an absolute path of - src="http://localhost/html2wp/wp-content/themes/ultimate/images/promo_image.png"

 

This needs to be changed to a relative path, or swap the 'localhost' server path to the new 000 web host path that your link points to thus - src="http://my-portfolio-site.site88.net/html2wp/wp-content/themes/ultimate/images/promo_image.png" (This is assuming you have the same directory tree.)

 

Hope this helps.

Edited by Weedy101

  • Author

Hi Weedy101,

 

Thank you so much for spending your valuable time for reply. I honestly say that nobody would ever tell me before about it like you. I am very glad and take it seriously as a result too. I hope you should continue help me and others in future as well.

Hi Weedy101,

 

Thank you so much for spending your valuable time for reply. I honestly say that nobody would ever tell me before about it like you. I am very glad and take it seriously as a result too. I hope you should continue help me and others in future as well.

 

Glad to help.

 

To solve issues like that all you need is the developer panel on your browser. Most browsers have them - use '[crtl]+[shift]+i' on most browsers to open it and start exploring the mass of information and facilities it provides :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.