Support #11624
closedChange pages into posts or swap database for a Commons site?
0%
Description
Working on our internal site.
Wondering if you could either:
Run this SQL:
UPDATE wp_posts SET post_type = 'post' WHERE post_type = 'page'
for:
https://gclibrarywiki.commons.gc.cuny.edu/
I did this on my own server.
Or if I give you a SQL file, can you swap it for what is already there?
The latter is preferred, because on my own server, I radically re-worked the entire taxonomy.
Updated by Stephen Klein over 5 years ago
Here is a link to the SQL dump:
library.gc.cuny.edu/aleph/projects/library_wiki.sql
Updated by Raymond Hoh over 5 years ago
- Category name set to WordPress (misc)
- Assignee changed from Boone Gorges to Raymond Hoh
- Target version set to Not tracked
Hi Stephen,
Boone is away at the moment, so I'll be handling this ticket.
I'd rather not deal with SQL exports and imports due to the nature of our caching system, which would require a script to purge all post caches.
Instead, I used a WP-CLI command to convert all existing posts to pages for the gclibrarywiki
site:
wp post update $(wp post list --post_type='post' --format=ids --url=https://gclibrarywiki.commons.gc.cuny.edu) --post_type=page --url=https://gclibrarywiki.commons.gc.cuny.edu
If you want to manage the ability to convert post types in the admin dashboard, we could install a plugin that handles this. Post Type Switcher appears to be a popular and decent plugin.
About your proposed taxonomy changes, it would be better if you outline what you did locally and what needs to be done for the gclibrarywiki
site.
Updated by Stephen Klein over 5 years ago
Thank you, Raymond. Actually, can you change pages into posts? I do not the plugin, because it will not be on-going.
In regards to taxonomy, I deleted all categories, applied new ones and used the 'List category posts' to group and create easier ToC's.
Updated by Raymond Hoh over 5 years ago
Oops! Sorry for reading that backwards, Stephen.
I just converted all pages to posts on the gclibrarywiki
site. Let me know if anything needs amending.
About the taxonomy changes, it would probably be better if you used the native WordPress Export / Import tools in the admin dashboard under "Tools".
From your internal site, on the "Tools > Export" page, you can export just the posts (this should include categories). Then, you can remove all the posts from the gclibrarywiki
admin dashboard and use your exported file from your internal site on the "Tools > Import" page.
Note: Before following what I recommend in the previous paragraph, it'd probably be best to do an export of the gclibrarywiki
site just in case! You should also test the import and export process locally as well.
Let me know if you have any questions.
Updated by Raymond Hoh 4 months ago
- Status changed from New to Resolved
Forgot to mark this ticket as resolved.