Back in April last year, I happily switched my 20 years old WordPress life-long blog to Ghost. I always like trying something new and it did seem to (partially) do the job. I came to term with the new software, imported all blog posts and it looked very nice and polished, with a very graphical theme (Dope).
Then it came the Activity Pub federation option, introduced since V.6 and I really felt to be part of it. I could finally federate my posts directly from the Ghost instance to the Fediverse, without the bother of back-linking and with the plus of having interactions like replies and favourites directly back on the post page.
All good.. I just had to set it up. This held me back from posting on the blog, as I wanted to have my writing federated and finally found time to do it. With bed result, as the Ghost instance was running behind Pangolin reverse proxy for tunneling, and as I discovered, Pangolin does not really go well with the Ghost federation work flow. It is just the way it is, as I discovered. Works well with native Caddy, but not behind Pangolin.
As so here I am again, back to my old Lover, WordPress. Not that I have done much on the Ghost instance a part from a couple of post, so I just basically reused the old WP installation, copied a couple of posts, and set it up on this new domain, following my usual manual migration I have learned over the years. This involved:
- Database SQL backup;
- Home directory Zip compression and download;
- New WP installation setup on the new domain, using Softacolous from cPanel;
- Zip backup uploading, making sure to rename two crucial files, .htaccess and wp-config.php, so the new database would connect to the old instance;
- Unzipping the old home folder over the new one, then deleting the new .htaccess and wp-config.php and renaming old ones;
- Dropping database tables from PhpMyAdmin, and uploading old database backup;
- And finally… a trade secret used since I started to use WordPress: SQL queries to update old domain to new domain.
Those are:
First query: UPDATE wp_options SET option_value = REPLACE(option_value, “ORIGINAL_URL”, “NEW_URL”);
Second query: UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, “ORIGINAL_URL”, “NEW_URL”);
Third query: UPDATE wp_posts SET guid = REPLACE(guid, “ORIGINAL_URL’, “NEW_URL”);
Fourth query: UPDATE wp_posts SET post_content = REPLACE(post_content, “ORIGINAL_URL”, “NEW_URL”);
After the old installation worked on the new host and new domain, I was then able to find a new free template based on Elementor, and .. Here we are again, back to my old Lover. If everything worked as it should, you may be reading this post from the Fediverse!!
And this may be the first of a long string of tech posts about my home-labbing and self-hosting experiences.