{"id":2901,"date":"2021-08-03T11:34:23","date_gmt":"2021-08-03T15:34:23","guid":{"rendered":"https:\/\/thewpgeek.com\/?p=2901"},"modified":"2021-08-03T11:34:25","modified_gmt":"2021-08-03T15:34:25","slug":"upload-your-bedrock-sage-theme-to-cpanel-hosting","status":"publish","type":"post","link":"https:\/\/thewpgeek.com\/upload-your-bedrock-sage-theme-to-cpanel-hosting\/","title":{"rendered":"Upload your Bedrock\/Sage theme to Cpanel Hosting"},"content":{"rendered":"\n

In this section, we will get Bedrock set up on Cpanel hosting. In the advanced section of the Cpanel hosting panel, you should find the terminal. Run this command<\/p>\n\n\n\n

Get to the public root directory, here you need to create new folder for a subdomain and go into that folder if you are following along. You can also use the domain root, but this will need you to make some changes to the document root later on to make this work. Once you have created your new folder, cd into it before running the install commands. <\/p>\n\n\n\n

cd public_html<\/code><\/pre>\n\n\n\n

now run the install commands for bedrock<\/p>\n\n\n\n

composer create-project roots\/bedrock<\/code><\/pre>\n\n\n\n

Upload your theme, DONT UPLOAD the node_modules folder! Before you do this build in your local environment using:<\/p>\n\n\n\n

npm run build:production<\/code><\/pre>\n\n\n\n

Upload to :<\/p>\n\n\n\n

bedrock\/web\/app\/themes\/<\/code><\/pre>\n\n\n\n

In local grab a copy of the database … Click the database tab, then “Adminer” you will likely have an error 404 – just wait for a second… Hopefully, that fixed itself, phew! Now click Export : <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

the defaults will be fine:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Okay, from Cpanel make a new database (in the MySql Databases option), Now create a new user, and add the user to the DB. Load up PhpMyAdmin and choose the new Database you created, click “Sql” and paste everything output by the export function in Local Adminer. <\/p>\n\n\n\n

Now go to cpanel > File Manager > Navigate to the “Bedrock” Folder. In the top right click “Settings” Select “Show Hidden Files” (Mine shoed it was selected, but I needed to click and save the checkbox before I could “actually” see hidden files! Rename the file .env.example to .env and edit the file, You need to change lines 1,2,3,13,14. These lines will be Database, username, password and URL, so have these ready. Once done generate new salts by visiting the link in the file, and pasting the result back.<\/p>\n\n\n\n

Now, we need to update the document root. I’m doing this with a subdomain here (easy) but you can also do it with the document root if you have access to whm, or contact your host. Create a new subdomain using the folder you used to put the files in. <\/p>\n\n\n\n

\"\"
Set up new Document root.<\/figcaption><\/figure>\n\n\n\n

Lastly, go back to your .env file and update lines 13,14<\/p>\n\n\n\n

WP_ENV='production'\nWP_HOME='https:\/\/examplesite.yourdomain.com'<\/code><\/pre>\n\n\n\n

Now visit the admin panel (https:\/\/yoursubdomain.yourdomain.com\/wp\/wp-admin)<\/p>\n\n\n\n

Change your password!<\/h4>

Now, BEFORE ANYTHING ELSE change your login password. Until now you have been developing locally and are probably using an insecure password, you have just copied the DB to a live site, your password now needs to be secure.<\/p><\/div><\/div>\n\n\n\n

go to themes, and activate your new theme!<\/p>\n\n\n\n

Now, back to the terminal in Cpanel, navigate to your new theme directory<\/p>\n\n\n\n

cd public_html\/examplesite\/bedrock\/web\/app\/themes\/yourtheme<\/code><\/pre>\n\n\n\n

run install<\/p>\n\n\n\n

composer install<\/code><\/pre>\n\n\n\n

in bedrock\/config\/environments\/ create the file “production.php”<\/p>\n\n\n\n

I always allow plugins to be updated and added from the wp-admin, so add this to the file if needed:<\/p>\n\n\n\n

Config::define('DISALLOW_FILE_MODS', false);<\/code><\/pre>\n\n\n\n

Now back to PhpMyAdmin, we need to update the site url from the localhost one to the live url. Update the first 2 items in wp_options<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Last thing, go to Settings > Permalinks > Save<\/strong><\/p>\n\n\n\n

So, did it work? If you want the site to be on the root of the domain and not a subdomain (which to be honest is usually the case) you will need full root access to your server. It really isnt too hard to do, but I realize many may not have the required access so decided to write the tutorial based on a subdomain. You can follow all the steps listed, but follow this guide to update your document root from WHM. <\/a> You may also want to do a refresher on saving and navigating using vim.<\/a><\/p>\n\n\n\n

Remember this stuff never gets easier, you just get better – and if you have got through all of this you are doing awesome!<\/p>\n","protected":false},"excerpt":{"rendered":"

In this section, we will get Bedrock set up on Cpanel hosting. In the advanced section of the Cpanel hosting panel, you should find the terminal. Run this command Get to the public root directory, here you need to create new folder for a subdomain and go into that folder if you are following along. […]<\/p>\n","protected":false},"author":1,"featured_media":2930,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_uag_custom_page_level_css":"","footnotes":""},"categories":[146],"tags":[149,116,147],"uagb_featured_image_src":{"full":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1.jpg",1920,1077,false],"thumbnail":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-150x150.jpg",150,150,true],"medium":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-300x168.jpg",300,168,true],"medium_large":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-768x431.jpg",768,431,true],"large":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-1024x574.jpg",1024,574,true],"1536x1536":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-1536x862.jpg",1536,862,true],"2048x2048":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1.jpg",1920,1077,false],"rigtest-featured":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1-720x480.jpg",720,480,true],"mailpoet_newsletter_max":["https:\/\/thewpgeek.com\/wp-content\/uploads\/2021\/08\/taylor-vick-M5tzZtFCOfs-unsplash-1.jpg",1320,740,false]},"uagb_author_info":{"display_name":"wpgeek","author_link":"https:\/\/thewpgeek.com\/author\/wpgeek\/"},"uagb_comment_info":4,"uagb_excerpt":"In this section, we will get Bedrock set up on Cpanel hosting. In the advanced section of the Cpanel hosting panel, you should find the terminal. Run this command Get to the public root directory, here you need to create new folder for a subdomain and go into that folder if you are following along.…","_links":{"self":[{"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/posts\/2901"}],"collection":[{"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/comments?post=2901"}],"version-history":[{"count":12,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/posts\/2901\/revisions"}],"predecessor-version":[{"id":2931,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/posts\/2901\/revisions\/2931"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/media\/2930"}],"wp:attachment":[{"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/media?parent=2901"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/categories?post=2901"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thewpgeek.com\/wp-json\/wp\/v2\/tags?post=2901"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}