Attempting to "un-Roots" one of my sites

For one of our Roots sites, a decision has been made to revert back the architecture into a “vanilla” WordPress site. I’d like to pick the brain of someone who could provide some advice.

My first thoughts are to create the wp-content/ directory move everything in there, and consolidate the functions.php file first - then move onto the database config and settings. Then attack all the php errors that pop up.

I’m also trying to gadge the level of effort this would take. So far it seems huge for one person.

Disclaimer: this isn’t a shot at the system. Just a one off situation where this needs to happen.

Thanks for reading.

It sounds to me like you’re trying to move away from Trellis and Bedrock, is that right? If so, I recommend setting up WordPress in a standard way, installing all the necessary plugins, and activating your theme, and importing your Bedrock database. It should actually work fine.

1 Like

Yup, that’s exactly what I’m doing.

So far I’ve done exactly what you’ve suggested.

As expected, I’m getting a “Class not found” errors. namespacing issues…

Can you share some of the errors? Trellis and Bedrock are pretty easily removed from the process --I’ve done it a few times myself without issue.

Fatal error: Class 'INC\Theme' not found in /srv/www/wordpress-default/wp-content/themes/INC/functions.php on line 77

Note: I’m using VVV locally

I’m assuming because I did not transfer over the Sage theme it can’t find anything from the Sage namespace. Namespace declarations are found in a lot of places.

use  Roots\Sage\Assets;

What version of sage?

Hi Austin, I’m running version 8.2.1. Has not been updated recently

Okay so which theme are you using?

  1. You have a fresh install of WordPress in VVV on your local machine with a different DNS name than the old “rootsified” site?
  2. You have manually installed all of the plugins that were on the rootsified site on the new site?
  3. You have installed the Sage-based site theme from the rootsified site on the new site?

Is the plan to keep using the Sage-based theme on the new site? If so, it should just work. If not, do you have custom plugins that might be referencing Sage’s namespaces? If you do, can you try deactivating those plugins?

If you plan on using a NEW theme, and NOT a sage-based theme, can you try activating “Twenty Sixteen” and seeing if the errors go away?

I’m sorry I’m not sure what would be causing these errors if you’ve activated your old theme on the new site --I’m hoping a clearer picture of the situation will help pin it down.

Like which places? In your theme? In your core files? In your plugins?

The theme you’re using gave you the exact place where it’s erroring. It cannot find the class Theme in the INC namespace. On line 77 of the theme’s functions.php file. I would start there, and try and find where that class is. I would assume in the theme, but possibly a plugin? INC obviously is not a Roots namespace or class, so it’s going to be hard for anyone here to debug further than the error you posted.

If you didn’t develop the theme, my only thought would be that someone created a Composer package and has classes that perhaps are used across multiple themes, that are installed with Composer.

There’s a couple of things going on here that are confusing.

If you’re using this INC theme, why would it be using the Sage namespace anyway? The themes should be totally independent (unless one’s a child, which shouldn’t be the case with Sage).

As stated above, sage can work perfectly fine outside of bedrock, and any theme installed in a bedrock site will work (in theory) in any other site. It sounds like you’ve managed to make the INC theme require Sage, which, if true, is definitely not good.

Your error message indicates the directory is themes/INC whereas psr-4 is looking in themes/inc, this might be causing you issues. Have you checked if the INC\ namespaces are being loaded at all into your functions file?

1 Like

I’d use WP Migrate DB Pro for the database and media files. Manually move the themes and plugins. Have done this before at request. Just make sure to do a find/replace in the DB to the new uploads directory as image linking will be broken.