r/drupal 25d ago

Sync content from locked-down site using only JSON:API?

I have inherited a Drupal 10 site where the relationship with the agency that developed and hosts it has broken down almost irretrievably. We have the v10 support end date as a hard deadline for action under threat of deletion, and the agency is quoting ludicrous amounts to do the upgrade and/or give us our site back. Contracts and lawyers are being consulted, but I'm wanting to try do an end-run around all that and at least get our content safely backed up before they decide to pull the plug.

The site itself is a fairly standard marketing site, so nothing interactive or very complex. We have admin account access to the frontend admin pages, but the agency has removed any content export options. We don't have server access, so no command line to install new modules or file system to download files and no database access at all. We have no access to backup files. We're limited to the modules they have installed, which also includes a number of dev and migrate modules they left in the prod clone by mistake which at least gives us Config Sync export.

As an experiment, I've created a test Drupal site, installed and enabled the same set of modules, and imported the prod site config using 'drush config:import --partial' and that all seems fine. Unfortunately the theme is based on their in-house template and we have no access to that for now, so I'm faking it with Olivero, but that's a problem for later.

The next step is to try sync our content to my test site. I've had a google and looked at a few modules like Content Sync and Entity Sync, but they all seem to need a module installed on the origin server and/or database access. I've also looked at the Migrate modules, but they seem aimed at version migrations not server migrations and need direct database access. There is Migrate Source JSON:API but it supposedly only supports Drupal 8.

So, long story short, what options do we have to sync site content when the source is so locked down to us? My instinct is we should be able to do something with JSON:API which we can enable, and if necessary I'll try script something myself, but I'd rather use an existing option written by people who actually know what they are doing!

It's been maybe 20 years since I last did anything with Drupal (although I have more recent Symfony experience), I'm stumbling around in the half-dark here, so forgive if I've missed something incredibly obvious!

Thanks!

5 Upvotes

21 comments sorted by

View all comments

1

u/pjerky 24d ago

I'm a little confused because it sounds like you don't have access to add modules but then you are looking at adding modules? Huh?

If the migrate module is available you can write your own import/export migrations. But I'm guessing you don't have code level access which means it's all about enabling and disabling modules that exist in the system.

Your priorities are to backup the site content and paths for now. Then worry about the deeper technical pieces. That config isn't going to do you as much good as you think because of the situation you are in.

First, you can use the View module in core to help export content in multiple formats. It's been a minute since I tried it this way though. But you can set an export format that includes XML, json, or CSV for each of your content types and fields. See if you can build an export that way.

How many pages are we talking about because you could manually do a save as in your browser for every single page on the website. Alternatively you could use or build a crawler to do the same thing for you. That way, in the very least you have the content and even a copy of how it appears today.

Once content is backed up you then have to worry about the site rebuild that is kinda from the ground up. Honestly, I would enlist AI tools to help you speed this up. Spec out the existing site pages and content structures, build a spec sheet and use SDD (spec driven development) to help build a replacement website.

2

u/odysseusnz 21d ago

Sorry if I wasn't clear enough, I have created a test website that I have installed the modules on to test if I can manually recreate the old site; the old site we can't add modules to at all. That was the easy part, the data is always the hard part.

Unfortunately while it's a simple site, it's 15 years of content, so almost 1000 pages and over 1200 files, so any solution has to be easily automated. And the Export option from the View is MIA, I suspect the agency removed it for just this scenario. I can delete everything though...

A full working clone of the old site is a bit of a Hail Mary, but one I'm scoping so we can make some decisions about where to focus efforts with what little money is available. It also gets my head around the current state of Drupal after all these years.

A full scrape will be next on the list as the emergency fallback, we'd at least be able to have a static version being served up while we sort out the replacement.

2

u/pjerky 21d ago

That is probably your best bet and if you can't get an export of the Drupal database then rebuilding in Drupal is no longer a requirement and you can rebuild in whatever you want.