Wordpress DB Question
- Started
- Last post
- 6 Responses
- mg33
Anyone have instructions or know of instructions for how to easily point to a different database for a Wordpress install? I'm working on a redesign of my site, and want to spend time tweaking a theme on a test WP install, but if I get it just the way I want i just assume point that to the content database used on my current blog once it's all complete. Does that make sense? This is on a C-Panel managed site/host if that helps.
Thanks.
- Jacque0
Without thinking about it too hard: edit the wp-config.php file at the Wordpress root to reflect the settings for your other database. Yes?
Thinking a little more: I'd imagine it might make sense to make sure your live and in-dev installs are the same point version and have all the same plugin's and whatnot installed so the database doesn't flip out looking for stuff that's not there.
- vaxorcist0
Are the test site and the live site on the same host? If so, database pointing shouldn't be too hard, wp-config.php... etc...
If you're developing on localhost and your db is on a server, some servers won't allow cross-domain mySQL queries, but some will....
- mg330
Thanks. Piece of cake to change actually with that advice. However, on the test instance, it doesn't show any posts, but does show the design aspects. Any thoughts?
- mg330
Actually, I don't know if this is going to work. Maybe a different question... I want the content from the live blog to be included in the test blog, not the entire design and layout.
I'm setting up a new theme on this new test instance, just want the content there if possible.
- Complexfruit0
If you want your posts/pages...go to Tools > Export and then you can import that into your test site.
- jpea0
Just create a subdomain in cpanel for your new install, then dev your new site on that subdomain. Once it's all set, go into phpMyAdmin of your new install database, export the whole db, open up in a text editor, find/replace your new subdomain with the live domain you're moving to, save file. Move your assets/theme folder for the new site to the live site location. Import your new site SQL file into your live site DB (save your old DB just in case). Make sure the site_url variable in the SQL file is your new site too. That should be it.