Continuation of posts in a new database WORDPRESS

jootess

Regular Member
Joined
Feb 17, 2022
Messages
240
Reaction score
27
I have published a thousand posts on my site so far. I want the posts to be placed in another database in the future, that is, from now on. Actually, I want to create another database and continue the posts in that database. I use WordPress. How can I do this? I know how to create a new database, but how should I determine that the continuation of the posts will be placed in the new database?
 
It depends on what you mean by "continuation". Do you mean your wp post may have future versions on the new db? If so, I would recommend doing the migration first.

Doing a migration is straight-forward. Download a sql backup (without the CREATE TABLE syntax... look for advanced export options and select data only; and not the schema.), open the backup in a text editor, and find/replace all old domains (e.g. https://www.oldsite.com) with new domains (e.g. https://www.newdomain.com).

As soon as you import the sql backup to the new database, it should work just fine. Just make sure to replace the domain like I said earlier, otherwise your new site will redirect to the old one.

I am considering both your old and new site will have wp_ as the table prefix. If it is something else, you will need to change that as well (specially if the old and new version have different prefixes).

When you do this, if you face any kind of problem, feel free to tag me to this thread. Will do my best to help (for free ofcourse).

btw, thanks for the kind words man @tazarbm :D
 
Last edited:
btw, thanks for the kind words man @tazarbm :D
This is interesting... I was expecting to be reprehended for dragging you out of your lair but in return I get... thanked?? I didn't see this coming for sure :D

Anyway, you did help me a few times in the past with this alien language called "programming" that I never understand and such deeds cannot be forgotten :)
 
This is interesting... I was expecting to be reprehended for dragging you out of your lair but in return I get... thanked?? I didn't see this coming for sure :D
hahaha lol thanks again man. No, for any kind of programming question, I always feel excited! I love what i do lol. :p
 
It depends on what you mean by "continuation". Do you mean your wp post may have future versions on the new db? If so, I would recommend doing the migration first.

Doing a migration is straight-forward. Download a sql backup (without the CREATE TABLE syntax... look for advanced export options and select data only; and not the schema.), open the backup in a text editor, and find/replace all old domains (e.g. https://www.oldsite.com) with new domains (e.g. https://www.newdomain.com).

As soon as you import the sql backup to the new database, it should work just fine. Just make sure to replace the domain like I said earlier, otherwise your new site will redirect to the old one.

I am considering both your old and new site will have wp_ as the table prefix. If it is something else, you will need to change that as well (specially if the old and new version have different prefixes).

When you do this, if you face any kind of problem, feel free to tag me to this thread. Will do my best to help (for free ofcourse).

btw, thanks for the kind words man @tazarbm :D
I have already created a new database (second database). And I have installed WordPress in a new folder. But I want the posts that I have published in that new database (second database) to be displayed in the main folder of my site. Actually, I want to have two databases, but all posts should be together in one folder. It means that I don't want to have two WordPress. I want to have ONE WordPress with two databases so that all the posts from both databases are placed together and the new posts that I publish are placed in the second database.
 
I have already created a new database (second database). And I have installed WordPress in a new folder. But I want the posts that I have published in that new database (second database) to be displayed in the main folder of my site. Actually, I want to have two databases, but all posts should be together in one folder. It means that I don't want to have two WordPress. I want to have ONE WordPress with two databases so that all the posts from both databases are placed together and the new posts that I publish are placed in the second database.
@BlurryBit
 
I have already created a new database (second database). And I have installed WordPress in a new folder. But I want the posts that I have published in that new database (second database) to be displayed in the main folder of my site. Actually, I want to have two databases, but all posts should be together in one folder. It means that I don't want to have two WordPress. I want to have ONE WordPress with two databases so that all the posts from both databases are placed together and the new posts that I publish are placed in the second database.
That will require you to modify the WordPress source code somewhere,
It's not really a good choice,
Why don't you move the old database to a new one and your new posts will be saved in this one as well?
 
I have already created a new database (second database). And I have installed WordPress in a new folder. But I want the posts that I have published in that new database (second database) to be displayed in the main folder of my site. Actually, I want to have two databases, but all posts should be together in one folder. It means that I don't want to have two WordPress. I want to have ONE WordPress with two databases so that all the posts from both databases are placed together and the new posts that I publish are placed in the second database.
That’s not how wp works. Perhaps you could make a custom frontend with posts from both the wordpress installations. But wp itself loops from one database, not two.
 
To continue posts in a new database in WordPress, you'd need a custom solution or a plugin that offers this functionality.
 
Back
Top