Project

General

Profile

Actions

Support #11624

open

Change pages into posts or swap database for a Commons site?

Added by Stephen Klein over 4 years ago. Updated over 4 years ago.

Status:
New
Priority name:
Normal
Assignee:
Category name:
WordPress (misc)
Target version:
Start date:
2019-07-08
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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.

Actions #1

Updated by Stephen Klein over 4 years ago

Here is a link to the SQL dump:
library.gc.cuny.edu/aleph/projects/library_wiki.sql

Actions #2

Updated by Raymond Hoh over 4 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.

Actions #3

Updated by Stephen Klein over 4 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.

Actions #4

Updated by Raymond Hoh over 4 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.

Actions #5

Updated by Stephen Klein over 4 years ago

Thanks for running the SQL again.

Actions

Also available in: Atom PDF