user320227
user320227

Reputation: 15

How to change the domain only without migrating the files

I have two business domains, for example, domain.com and dev.domain.com. Since I had to keep the old website for running the business while developing website, I keep the old website to domain.com and bought the new theme, installed, and developed in dev.domain.com.

After finished the development, I wanted to use the domain.com instead of dev.domain.com, but when I migrate all the file, all the plug-ins were not working because of license reason. Since I don't want to develop entire website again, I just made domain.com to forwarding to dev.domain.com. Is there way I can change domain to domain.com?

Thanks,

Upvotes: 0

Views: 232

Answers (2)

Richard Miles
Richard Miles

Reputation: 557

https://codex.wordpress.org/Moving_WordPress#If_You_Have_Accidentally_Changed_your_WordPress_Site_URL.

This https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ is probably a better method than trying to load your entire db into a single text file is not the most viable option.

Upvotes: 0

Tom Green
Tom Green

Reputation: 305

Not entirely sure but you're probably getting errors because WordPress saves the site URL in the database so after you move the files to domain.com, the database is still requesting stuff from dev.domain.com. Changing the one table in the database (site_url under wp_options) is sometimes enough but if you've been developing a site I'm guessing you've got a bunch of links and images set up with the dev.domain.com URL. What I usually do when migrating a dev site to live is...

  1. Set up a new Database and User/Pass for the new live site.
  2. Export the database from the dev site.
  3. Open the database in Notepad++
  4. Use Find and Replace (ctr+h) to find dev.domain.com and replace with domain.com, choosing Replace All.
  5. Now import this database to the new database you set up earlier, and change the wp-config.php database settings to the new database.

Be sure to keep copies of the backup before you edit the database in case anything goes wrong, but you should be good. This is how I do it all the time.

Upvotes: 0

Related Questions