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 Wordpress from localhost to live?

Featured Replies

Bit of a Wordpress noob, but seems like a simple fix that I can't get to work! Hope someone can help me!

 

So, I have a wordpress theme all working and looking nice on my localhost. I now want to move it to a subdomain on my own site so that the client can view and populate the database online, but I can't seem to establish a database connection! (im using phpadmin/cpanel)

 

- I've exported the database to a .sql then changed all the localhost instances to that of my subdomain

- I've imported the database via phpadmin

- I've edited the web.config to match the name of the stuff in phpadmin

- I've tried to change the path of the url in wp-admin but throws a server error, same with the permalinks

 

Can anyone see any glaring points I've overlooked or point me in the right direction?

 

Much appreciated

Leo

Bit of a Wordpress noob, but seems like a simple fix that I can't get to work! Hope someone can help me!

 

So, I have a wordpress theme all working and looking nice on my localhost. I now want to move it to a subdomain on my own site so that the client can view and populate the database online, but I can't seem to establish a database connection! (im using phpadmin/cpanel)

 

- I've exported the database to a .sql then changed all the localhost instances to that of my subdomain

- I've imported the database via phpadmin

- I've edited the web.config to match the name of the stuff in phpadmin

- I've tried to change the path of the url in wp-admin but throws a server error, same with the permalinks

 

Can anyone see any glaring points I've overlooked or point me in the right direction?

 

Much appreciated

Leo

 

 

What's the error you're seeing?

 

If you're also having problems with Permalinks, check your .htaccess file to ensure you have the correct mod_rewrite rules.

 

 

Did you change the database settings? The wordpress domain etc is set in the DB in the wp_settings table (i think)

Have you changed the details in your wp-config.php file? If not, then what are the chances of your local host and your actual host database settings of being the same? Almost nil. Make sure the database name, database user, and database password are all correct before proceeding.

  • Author

ok, with all your guidance so far, ive managed to connect to the database but it is not able to select the database now! Here's the error message I'm getting. It is definitely named correctly in the wp-config.php file so I'm assuming the user hasn't got all permissions, but in phpadmin i cant seem to be able to set the permissions... any ideas?

 

Can’t select database
We were able to connect to the database server (which means your username and password is okay) but not able to select the xxx_yyy database.

   * Are you sure it exists?
   * Does the user xxx_zzz have permission to use the xxx_yyy database?
   * On some systems the name of your database is prefixed with your username, so it would be like username_xxx_yyy. Could that be the problem?

Have you definitely added the MySQL user to this database in your hosting control panel? This is usually done separately from database admin functions ie phpmyadmin.

  • Author

Have you definitely added the MySQL user to this database in your hosting control panel? This is usually done separately from database admin functions ie phpadmin.

 

In my hosting providers cpanel, I created a new database and a new user... then I edited the config file to match the DB_NAME, DB_USER etc... then after changing all the paths in the .sql, I imported my database via phpmyadmin.

 

Thanks for all the help so far! I bet it's something so obvious that I've missed, and so close to working, so freakin' annoying lol!

Check the top of the sql file you imported into the new database - just before the table structure starts there is the name of the database. Just change it to whatever the new one is. At least that's what has caught me out a few times before.

 

If it helps here's a checklist of what to do when moving Wordpress from localhost:

 

1. Set up the new database and user at the new domain

2. Export the localhost database into an sql file

3. In that sql file change all instances 'localhost/example' to the new domain name

4. Also change the database name near the top of that sql file to the new database name

5. Upload contents of 'localhost/example' folder to the new domain (not the single folder - the files and folders in it, like wp-content, wp-admin etc)

6. Once uploaded, edit the wp-config.php file you just uploaded to the new settings

7. Using phpmyadmin check that the new database's 'options' table has the new location of the site and the uploads folder (should be just wp-content/uploads)

8. Install Wordpress at http://example.com/wp-admin/install.php

 

I think that covers it but let me know if I missed anything out.

  • Author

mrp, thanks for the step by step list! :good: you might be onto something with the database name at the top of the .sql file. I'll check it tonight after work and will probably just delete everything and go through your list meticulously and systematically and hopefully it should work... will post again if not! Cheers

 

Check the top of the sql file you imported into the new database - just before the table structure starts there is the name of the database. Just change it to whatever the new one is. At least that's what has caught me out a few times before.

 

If it helps here's a checklist of what to do when moving Wordpress from localhost:

 

1. Set up the new database and user at the new domain

2. Export the localhost database into an sql file

3. In that sql file change all instances 'localhost/example' to the new domain name

4. Also change the database name near the top of that sql file to the new database name

5. Upload contents of 'localhost/example' folder to the new domain (not the single folder - the files and folders in it, like wp-content, wp-admin etc)

6. Once uploaded, edit the wp-config.php file you just uploaded to the new settings

7. Using phpmyadmin check that the new database's 'options' table has the new location of the site and the uploads folder (should be just wp-content/uploads)

8. Install Wordpress at http://example.com/wp-admin/install.php

 

I think that covers it but let me know if I missed anything out.

Cool, no worries - try it before you start over again though as it'll save you half an hour of your life! Sounds like everything else is fine.

Make sure when you do upload it successfully and have the site running that you change some options in your wp_options for the online site

they should have http://localhost/example/ as their value. The options names are siteurl and home. Not changing these will cause your site to redirect back to your localhost automatically

  • Author

ahhhh, im so happy, finally got it live onto my subdomain! Turns out the user didn't have all permissions! Am now trying to fix my permalinks/paths/css etc, one fix uncovers several more problems! I would like to say thanks to all who have helped! That's why I love this place! Site up for review very soon (after I fix these bugs), cheers all! :good:

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.