Any Wordpress Gurus out there?

Jason

Ideas bounce around in my head
Super Member
Registered
Joined
Oct 26, 2016
Messages
6,011
Reaction score
1,036
Location
Nashville, TN
Hey all - I am hip deep in the middle of trying to restore a Wordpress blog that I'd had up on a friends server forever ago. I finally decided it'd be a shame to lose all those years of content (about 10 actually!), and have begun the work of restoring the site. It's already up and running, and as I have time I am going back and trying to re-inject content courtesy of The Wayback Machine (love that site!).

The problem that I am encountering is that when I go to re-inject images from the history of folders I have (wp-content/uploads/2007/1/samplefile.jpg), the Wordpress media dashboard does not seem to be detecting the content I had gone in and uploaded back from a backup I had made via FTP. Instead, it's only showing me media folders from 2017. It seems like there would be a plugin or something that would restore or resync the folder structure to the dashboard in Wordpress but I am not finding anything in Wordpress codex.

In essence, it seems that there is a disconnect between the Wordpress dashboard and the file manager for my image libraries...any ideas on how to reconnect or resync them?

As an aside, I'd rather not go the route of a paid plugin if at all possible....already probably overspent to have Bluehost do an import for me to transfer everything over - will be calling their Wordpress support team at 9am Mountain time when they open here later. Just thought I'd throw it out there here in case any gurus might have a good idea. Tks in advance! :)
 

AW Admin

Administrator
Super Member
Registered
Joined
Apr 19, 2008
Messages
18,772
Reaction score
6,283
First, the best way to move a WordPress site is to import/move the MySQL database
Second, there are backup/move plugins designed to do this for you
Third, the second best way is to use the WordPress Export tool
Fourth, the issue is likely one of paths; you need to make sure that your paths match the path the server is using to locate images; you can fix this via search and replace (export all the posts/pages, etc, use a text editor, then import) but it requires determining the base path and making sure the file structure is exact, then doing the search and replace; I realize you've figured this out, but others might not.
I have not used a plugin to do this; there are some listed in the WordPress database.
 

EMaree

a demon for tea
Super Member
Registered
Joined
Jul 7, 2009
Messages
4,655
Reaction score
839
Location
Scotland
Website
www.emmamaree.com
Give this free 'Add from server' plugin a try. I think it'll do what you're needing, forcing the media library to recognise files that are already in wp-content/uploads/, but I haven't tried it myself.

If that doesn't work... is there any way you can get access to the old version of the site and do an export (Admin panel > Tools > Export > 'All Content'), then import that data (Admin panel > Tools > Import - It will instruct you to install the Wordpress importer, this is a free plugin)?

It's the standard way to do this sort of transfer and it's a lot quicker than your current way (unless you run into file size limits, then it's a pain) but I can't tell from your post if you have any access to the old site's admin backend.
 

Jason

Ideas bounce around in my head
Super Member
Registered
Joined
Oct 26, 2016
Messages
6,011
Reaction score
1,036
Location
Nashville, TN
Yeah, it's the age old problem of the server that hosted the content crashing, so no backend access anymore...I'll be talking to the Bluehost WP team here shortly, but will also take a look at the plugin you referenced. Tks to both! :)
 

Jason

Ideas bounce around in my head
Super Member
Registered
Joined
Oct 26, 2016
Messages
6,011
Reaction score
1,036
Location
Nashville, TN
So, as a word to the wise, backing up is one thing - verifying said backups, testing said backups, and restoring from said backups is another thing altogether.

With a site that is live, this is not always feasible, and many of the backup options do not perform a full site backup. Most are complete crap actually - even the paid for plugins, because unless you pay for support in perpetuity, you cannot restore from those backups.

So, if you want to back up your Wordpress website and not pay a ton for it over time, then the only way is if you have server level access and can maintain said server. Of course, if I had server level access, it never would have crashed to begin with, but then again, hosting was free, so I really got what I paid for at the end of the day! Anyway, back on the topic of backing up any CMS system, this is much easier said than done for most people. Trust me, I have been pretty religious about backing up content both personally and professionally over the last....yeah, 20+ years.

When it came to a personal blog, I made two fatal errors:

1. I made the dangerous assumption about the default plugins that claim to be saving backup files, and not testing them - because who does that on a frigging personal blog?!?!

2. I made the mistake of relying on a "friend" who had access to a public-facing web server that could provide me with free hosting. A good deal for the last ten years, but when the %^&* hit the fan and it died, he was cut off from his access, which effectively killed my access. It's not like he could say "Oh yeah, by the way me and several buddies have been basically borrowing your server, bandwidth, and what not free for nearly 10 years... I had assumed he was actually in full control of the server - that it was his. No, turns out he was squatting on a web server for a company he had apparently left several years prior and never bothered to tell me that he may lose access at any time.

A true backup means you have access to and can restore at a minimum: your posts, articles, photos, traffic data, plugins, themes, customizations, and visitor comments. Valuable lesson learned, and now I am in the midst of restoring content - which I don't mind doing as a sort of personal labor of love, but still grimacing over WP difficulties.

Anyway, back on topic - the problem is not porting content into Wordpress - the content is already in there, it's getting the dashboard GUI of Wordpress to see said content. Perhaps this will explain it better:



So, in essence, the folders that I am displaying on the right is via the FTP GUI, and on the left is the dashboard for inserting previously created media does not include any of the media prior to 2017. There simply must be a way to force WP to re-connect or re-sync what it thinks is the image library with the actual image library..... :Headbang::Headbang:

It's actually really starting to annoy me that there is no way to make this happen either natively in WP or via a plugin - almost to the point where I am thinking "surely this would not be a difficult plugin to develop - it's just to force Wordpress to use the file manager to accurately display what is already there...

Final note here:

EMaree's suggestion actually did end up working, albeit a bit wonky of an interface as I still had to go in and manually tell it to re-associate the import from where it should have already known how to read that location on it's own, so a plugin built specifically for that purpose would ideally just be a one-click button or something to re-scan the Uploads folder...
 
Last edited:

AW Admin

Administrator
Super Member
Registered
Joined
Apr 19, 2008
Messages
18,772
Reaction score
6,283
One should back up EVERYTHING now and then. ;) My website was once toasted in a server fire, nothing permanently lost. Wordpress is remarkably portable. If.

Yes. This.

Regarding WordPress backups for self-hosted WordPress.org:

1. Get a MySQL dump of the database. Make sure you know the password and User for said database. Most hosts offer PHPMyAdmin; it's a read the screen kind of things to download a local copy of your database. Some hosts will get this for you. There are plugins to do automatic MySQL dumps and email them or stash them; these still need to be verified, and I wouldn't rely exclusively on them. Get your own download of the database.
2. Make sure you have a copy of the WordPress Content folder, or at least the Uploads directory. That's where your image files live. You'll need SFTP/FTP for this; there are plugins that wll do this, but again, verifiy that the download works, and is usable, and I'd still regularly get my own.
3. Use the Tools -->Export-->All Content option in the WordPress Dashboard to export the posts/pages/comments as an XML file. This is a belt-and-suspenders method; you'll at least have your content if all else fails.
4. Get these files regularly. Keep at least two previous versions.
5. Take screen shots of your layout/design; keep a record of the important data in Settings (like your paths in Settings and Media) and the theme and plugins you're using.
 

AW Admin

Administrator
Super Member
Registered
Joined
Apr 19, 2008
Messages
18,772
Reaction score
6,283
There simply must be a way to force WP to re-connect or re-sync what it thinks is the image library with the actual image library

Yes; this is a path issue. I'm pretty sure there are plugins; frankly, I've always used search and replace either via the XML files or via MySQL to correct the path.
 

TrinaM

Super Member
Registered
Joined
Apr 29, 2017
Messages
115
Reaction score
45
Location
Pacific NW US
Website
trinamalone.com
(whispers) Don't trust your hosting company's backups, either. Make sure you have your own.

Glad you got that sorted out!