fbpx
NeONBRAND Marketing & Business Development Experts
Contact Us
Site Navigation
  • Home
  • SEO
  • Social Media
  • Websites
  • Consulting
  • Contact Us
    • Las Vegas, NV
    • St. George, UT
    • Cedar City, UT
    • Provo, UT
  • Extras
    • About
    • Team
    • Portfolio
    • Website Hosting
    • Blog
    • Ebooks
    • Digital Marketing Dictionary

How to Convert Vanilla WP Site to Bedrock (and Vice Versa)

Originally posted: August 21, 2020 by Kenny Eliason. Leave a comment
Scroll to Next
Convert-to-or-from-a-Bedrock-WordPress-Installation
Get Updates to Your Inbox!
This field is for validation purposes and should be left unchanged.

Home » Websites » WordPress Tips and Tutorials » How to Convert Vanilla WP Site to Bedrock (and Vice Versa)

Reading Time: 7 minutes
  • Twitter
  • Facebook
  • Pinterest
  • LinkedIn

Admittedly we are huge fans of Roots.io and their products, primarily Bedrock and Sage.

So when we inherit a vanilla WordPress site from another developer, the first thing we do is convert that site over to the Bedrock Framework.

Here we’ll show you the steps we take to convert a vanilla WordPress site over to Bedrock, and down below that we’ll show you how to convert it back.

Table of contents

  • Requirements
  • Convert Vanilla WordPress to Bedrock
    • Step 1 – Installing Bedrock
    • Step 2 – Migrate over the Themes folder from the Vanilla WP Site
    • Step 3 – Migrate Plugins
      • How to Install Premium Plugins with Composer
    • Step 4 – Migrate Uploads Folder
    • Step 5 – Importing the Database
    • Converting to Bedrock
  • How to Convert Bedrock to Vanilla WordPress
    • Step 1 – Install Vanilla WordPress
    • Step 2 – Copy app to wp-content Directory
    • Step 3 – Remove Unused mu-plugins
    • Step 4 – Import Database
    • Converting to WordPress
  • Converting To/From Bedrock Bash Script

Requirements

To effectively change a site from vanilla WP over to Bedrock, you’re going to need a local development environment as a lot of what we do is done from the command-line. We highly recommend this tutorial on Setting up a Dev Machine by Jeffrey Way.

Make sure you have the WP-CLI tool installed on your machine as well.

It would really help if you have a decent understanding of how both the normal WordPress folder structure works as well as an added bonus if you have a basic understanding of the Bedrock framework.

You will need a full copy of the current Vanilla WP website with its database working locally on your machine.

Convert Vanilla WordPress to Bedrock

Step 1 – Installing Bedrock

Create a new database on your local environment for this new website. I’m not going to go into how to do that, as most WordPress devs are comfortable with that step.

Next, you’ll need to install Bedrock, which is done using composer. From the command line, you’ll run the following command inside of your development folder, replacing {sitename} with your site name. This should be a different name than your permanent site name so that you don’t overwrite any files:

composer create-project roots/bedrock {sitename}
installing roots-bedrock from command line

You’ll then need to open the .env file and rename all the variables according to your new site’s specifications:

update-.env-file

Step 2 – Migrate over the Themes folder from the Vanilla WP Site

One thing to note when it comes to your new Bedrock site is that the folder structure is much different (read better 😉) than the standard WordPress way of doing things. Instead of a wp-content folder, you will find an app folder inside of the “web” directory.

You’ll need to move the themes from your current vanilla WP site over to your new Bedrock install. From your development directory, from the command line I would use a command like this one:

cp -R {vanillawpsite}/wp-content/themes/* {bedrocksite}/web/app/themes

That should create a copy of every theme you were using on your old site on this newly created Bedrock site.

Step 3 – Migrate Plugins

This step is a little more time intensive as we’re going to properly install all of your plugins using Composer.

A composer version of every free WordPress theme and plugin can be found on WP Packagist, which we are definitely going to use.

Your premium plugins are going to be a little more complicated… we’ll get to that later.

Navigate to your vanilla WP directory and using the WP-CLI tool, you’re going to get a complete list of all the plugins on your site.

wp plugin list

You have two options at this point, navigate to wpackagist.org and look up each plugin one by one, which might be easy if there aren’t very many plugins.

To install them with composer, you can install each free plugin by using the following command:

composer require wpackagist-plugin/{plugin-string}

For example, installing the Advanced Custom Fields plugin would look like this:

composer require wpackagist-plugin/advanced-custom-fields

Go through one by one and install all of the free plugins.

I prefer to do it in bulk, but it involves copy and pasting the list of plugins output by ‘wp plugin list’ into Excel, transposing, concatenating… etc. If you’re an Excel person, you’ll probably figure out what I’m talking about. You can install multiple composer files at a time by listing them out one at a time, like this:

composer require wpackagist-plugin/advanced-custom-fields  wpackagist-plugin/akismet wpackagist-plugin/bbpress wpackagist-plugin/classic-editor wpackagist-plugin/google-analytics-for-wordpress

How to Install Premium Plugins with Composer

Premium plugins are an entirely different animal, luckily more and more plugin devs are adding the ability to install their plugins via composer, like Yoast (Side note, Yoast is a fan of Bedrock 😃).

If your developer still hasn’t added that feature, we suggest looking into setting something up like Satispress on another install of WordPress to manage your premium plugins. It’s a bit of extra work at the beginning, but it makes for a stellar premium plugin repo for later!

Step 4 – Migrate Uploads Folder

Depending on the site, this could be where a majority of the bulk of your file size could be located. You’ll likely want to use rsync from the terminal to move everything so that you can repeat the process if necessary. Here’s the command I like to use:

rsync -vrz {vanillawp/wp-content/} {bedrock/web/app}

Make sure you have the trailing slash after “wp-content” so that it copies the content of the directory, and not the directory itself.

Step 5 – Importing the Database

A quick way to get a copy of the vanilla database is to navigate to that folder on your local system and enter this WP-CLI export command:

wp db export

That short little one-liner will create a SQL dump file very quickly at the root of your site.

Copy that file over to your new Bedrock directory, and then run this WP-CLI import command:

wp db import

As long as there is only one sql file in the directory, it will find it and import it for you auto-magically.

But the fun doesn’t end there… This is where things can get a little tricky.

We need to search and replace a number of strings in the database, and to do that we’re going to use another WP-CLI command, search-replace. Since this is a new site and not your live site, we don’t have to worry about backups because if you destroy your DB, you’ll still have that vanilla WordPress install you can go and export again.

Here is a list of the commands you’ll want to consider running:

wp search-replace "{vanilla-wp-domain}" "{bedrock-wp-domain}"

wp search-replace "/wp-content/" "/app/"

wp option update home "http://{bedrock-wp-local-url}"

wp option update siteurl "http://{bedrock-wp-local-url}"

That should catch 90%+ of the changes needed to make your database work with Bedrock correctly.

If you’re using a page builder, you may have an additional step of searching out any more strings that need to be replaced as page builders usually escape the forward-slash in a URL.

Converting to Bedrock

Your site “should” be up and running by now… Every install is SOOOO different so I’m sure it wasn’t super straight forward or even super easy. But hopefully you’ve been able to muddle your way through it.

How to Convert Bedrock to Vanilla WordPress

Now for the reason most of you are here, this is how you would convert a Bedrock instance of WordPress back to your regular ol’ Vanilla WordPress.

We understand many people who build sites with WordPress don’t understand the additional functionality provided by Bedrock, and that is just fine. Hopefully this tutorial will help guide you on getting your site back to normal.

Here I’ll walk you through the basics of converting your site FROM Bedrock TO Vanilla WP.

Step 1 – Install Vanilla WordPress

Create a folder for your new vanilla WordPress site, and enter into the new directory. From that directory enter the following, one at a time:

wp core download

wp config create --dbname={vanilladb} --dbuser={vanilladbuser} --dbpass={vanilladbpass}

Step 2 – Copy app to wp-content Directory

The app folder on the bedrock install contains everything you’ll need for your vanilla wp-content folder. To copy those over you can use one of two scripts. I prefer using rsync, especially if you have a large uploads folder.

rsync -vrz {bedrock/web/app/} {vanillawp/wp-content}

Rsync allows you to run it a few times but not copy over the same files every time. But if you don’t want to use rsync, you can use the regular copy command as well.

cp -R {bedrockwp/web/app/} {vanillawp/wp-content}

Make sure you have the trailing slash after “app” so that it copies the content of the directory, and not the directory itself.

Step 3 – Remove Unused mu-plugins

You’ll want to take a quick peak at your wp-content/mu-plugins directory and remove anything bedrock related, some of those that should be removed are:

  • bedrock-autoloader.php
  • disallow-indexing.php
  • register-theme-directory.php

Step 4 – Import Database

From your functioning Bedrock install directory, run the following command to export the database:

wp db export

Then move or copy that file over to your new vanilla WordPress directory and run:

wp db import

Then to get the database running as it should, run the following search-replace commands one at a time:

wp search-replace "{vanilla-wp-domain}" "{bedrock-wp-domain}"

wp search-replace "/app/" "/wp-content/"

wp option update home "http://{vanilla-wp-local-url}"

wp option update siteurl "http://{vanilla-wp-local-url}"

Converting to WordPress

Now that should get you going on your vanilla WP site. I’m sure you’ll run into at least 1 problem, though, so brace yourself. Be creative and use the above information to find a solution, I’m sure you can do it.

Converting To/From Bedrock Bash Script

If you made it this far in your quest, you are now worthy to have the golden script… This script is not perfect, but it does all of the things I laid out above in a fraction of the time, all automated.

So far we have only built out half of this script… Going from Bedrock to WordPress as that seems to be the most easily scripted. You’ll want to use the following command once you have the script downloaded:

sh makewpsuck.sh --more

The script name was inspired by a previous script I had seen on the internet, but can no longer seem to locate. So we created a new one ourselves.

Download the script by clicking the image below:

Make-WP-Suck-Less-or-More
  • Twitter
  • Facebook
  • Pinterest
  • LinkedIn
Published: August 21, 2020
Updated: November 18, 2022
Headline: How to Convert Vanilla WP Site to Bedrock (and Vice Versa)
Image: installing roots-bedrock from command line Height: Width:

Image: update-.env-file Height: Width:

Image: Make-WP-Suck-Less-or-More Height: Width:

Image: Convert-to-or-from-a-Bedrock-WordPress-Installation Height: 1080 Width: 1620

Publisher: NeONBRAND https://neonbrand.com
NeONBRAND https://neonbrand.com/app/themes/neonbrand/dist/images/logo-gray_280c67fe.png 98 120

« The Perfect Client-Agency Relationship
A Useful Guide to Better Understand SEO Services »

2 responses to “How to Convert Vanilla WP Site to Bedrock (and Vice Versa)”

  1. Martin Martin says:
    December 16, 2020 at 4:58 am

    Great guide, thanks! Quick note:

    Step 4 shows the following bedrock path, but it should probably be {bedrock/web/app/uploads/}?

    rsync -vrz {vanillawp/wp-content/} {bedrock/web/app}

    Kind regards,
    Martin

    Reply
    • Kenny Eliason Kenny Eliason says:
      January 25, 2021 at 10:36 pm

      Hey Martin! Thanks for the feedback. I’m actually pretty certain on the way I have it, as with Bedrock the entire wp-content folder gets moved to the app folder! Hope that worked for ya.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

About the Author
Kenny Eliason
Kenny Eliason
Having grown up the son of a marketer, the skills of the trade are pumping through his blood. When you couple that with his programming and computer knowledge, you get an explosive combination. Kenny has been an avid digital marketer for over 9 years now, often being the first to recognize the hottest trends coming to the market. In his free time, Kenny loves downhill mountain biking. He calls it his "old man sport" since BMX was what he did as a teenager and it's not quite as easy to ride those little bikes anymore. Kenny is also a huge technology enthusiast, specifically when it comes to Apple products - did someone say, fanboy? Those close to him are often asking for help solving tech-related problems which often results with them saying, "man, you can fix anything!"
Search
Search
Blog Categories
  • Instagram Marketing (6)
  • E-Commerce Support (1)
  • Keywords for SEO (3)
  • WordPress Tips and Tutorials (17)
  • LinkedIn Marketing (2)
  • Consulting (15)
  • Websites (12)
  • Content for SEO (33)
  • Link Building for SEO (6)
  • Marketing Strategy (60)
  • Twitter Marketing (6)
  • Facebook Marketing (33)
  • Local SEO (13)
  • Business Consulting (35)
  • The Kurt & Kenny Podcast! (13)
  • Web Development (4)
  • Video Marketing (10)
  • Uncategorized (1)
  • Website Design (21)
  • Social Media Marketing (94)
  • Search Engine Optimization (82)
  • Home
  • Search Engine Optimization
  • Social Media
  • Website Design
  • Business Consulting
  • Digital Marketing
  • Video Marketing
  • Email Marketing
  • WooCommerce Development
  • Traditional Advertising
  • Retail Marketing
  • Dentist Marketing
  • Hotel Marketing
  • Medical Marketing
NeONBRAND Newsletter
Don't live with FOMO. Get subscribed to our newsletter and never worry about missing the awesomeness ever again.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.

(702) 706-NeON
  • Las Vegas, NV
  • St. George, UT
  • Cedar City, UT
  • Provo, UT
  • NW Las Vegas, NV
  • Sitemap
  • © 2023 NeONBRAND. All Rights Reserved.