HOWTO.bluehost - raynaldmo/HOWTO GitHub Wiki

Bluehost DevOps

Resources

SSH access

  • From local machine
    • Attempt to ssh into server
ssh -p 2222 user_namer@server_ip_address
[enter my.bluehost.com account password]
  • If not authorized, contact Bluehost tech support to enable access - via chat
  • Check that ssh works

Enable password-less SSH access

Site Sync / Backup Solutions

References

Tools -> Export / Import

  • Exports / Imports site content only using XML file
  • Doesn't handle
    • Source files (core, theme, plugin)
    • Media files
    • Full database

WP Migrate DB

  • Exports site's database only
  • Use PhpMyAdmin or mysql to import database (yuck!)
  • Doesn't handle
    • Source files (core, theme, plugin)
    • Media files

WP Migrate DB Pro $200 yikes!

  • Exports / Imports
    • Full database
    • Media files
    • Theme and plugin files (optional)
  • Doesn't handle core files

All-in-One WP Migration

  • Exports
    • Source files (core, theme, plugin)
    • Full database
    • Media files
  • Exports backup on local machine
    • Generated proprietary .wpress file

All-in-One WP Migration Pro

BackWPup

  • Exports
    • Source files (core, theme, plugin)
    • Full database
    • Media files
    • Content
  • Exports backup on site directory on server ../wp-content/uploads/
    • Generate .zip file
    • Was able to import .zip file into Local by Flywheel and launch local site

BackWPup Pro - $84

  • Handles import

WP-CLI

  • TBD

Workflow (Staging Site version)

  • Create site and Enable Coming soon

  • Configure site (add plugins, theme, content etc.)

  • Launch site

  • Site changes

    • Create staging site
    • Make changes
    • Copy staging to live
  • Later on figure out workflow for dev - prod site

Workflow (Local by Flywheel version)

Site Creation

  • Create bitbucket remote repo on RNJ Web Design account
  • Use https and not ssh

Bluehost Server

  • Create vanilla site - Enable Coming Soon feature
  • Disable core , plugin, theme auto update
  • From production site Dashboard, download and install BackWPup
  • Generate a site backup using BackWPup
    • Select Database backup, File backup, WordPress XML export, Installed plugins list for backup
  • SSH into server
  • zip file will generated as seen below
// example backup file location
[email protected] [~/public_html/wp-content/uploads/backwpup-8c6ce3-backups]# ls
./  ../  .donotbackup  .htaccess  2020-04-17_22-11-28_ROGGZYZV01.zip  index.php

Local machine

  • Use scp to copy zip file to local machine
  • On local machine
~/Desktop/RNJ Web Design/rnjwebdesign/db $ scp [email protected]:/home4/mrpatchr/public_html/wp-content/uploads/backwpup-02738a-backups/2020-04-18_17-19-17_JABHHCVJ01.zip .

  • Use Local by Flywheel (LBF) to Import site

  • At this point local site should be a virtual copy of vanilla production site

  • Configure site (add theme, plugins, content etc.) on dev / local site

Initial Deploy

  • Use BackWPup PRO to copy configuration to prod site
  • Need free tool to import / export
  • Test prod site
  • Remove Coming Soon from prod site
  • Site is live!

Site Updates

Content

  • Add content (pages, post media) directly on prod site

Plugin Changes (add / remove / update)

  • Install and test plugin on dev site

Theme Changes

  • Only do update to current theme

Backups

  • Options use git or use staging site ?
  • Only use Git for custom themes and plugins ?
  • Let bluehost auto update core and released themes/plugins

Site Re-design

  • TBD

Workflow

Site Creation

  • Create bitbucket remote repo on RNJ Web Design account
  • Use https and not ssh

Bluehost Server

  • Create vanilla site (Enable Coming Soon feature)
  • Disable core , plugin, theme auto update
  • Use SSH, create and push local git repo to Bitbucket remote repo
[email protected] [~/public_html]# pwd
/home4/mrpatchr/public_html

// .gitignore contents 
// don't commit wp-config.php file
# cat .gitignore 
.idea/
jaesinteriors/
wp-config.php
.htaccess
cgi-bin/
.well-known/
error_log

# git init

// avoid error: fatal: unable to create thread: Resource temporarily unavailable
// when pushing code to bitbucket remote repo
// See: https://stackoverflow.com/questions/9905257/git-push-fatal-unable-to-create-thread-resource-
# git config --global pack.threads "10"

# add git remote - use https and not ssh
# git remote add origin https://<user_name>@bitbucket.org/<user_name>/<repo_name>.git

# cache Bitbucket git repo credentials for one week
# git config --global credential.helper "cache --timeout=604800"

# git add .
# git ci -m "Initial commit"
# git push -u origin master

  • From production site Dashboard, export content
    • (WP Migrate DB Pro instead ?)
    • Tools -> Export
    • Save to RNJ Web Design site directory (db) on local machine

Local machine

  • Clone bitbucket repo
  • Pull code from remote repo
  • Create site using Local by Flywheel
    • Import site
    • Import database
    • Configure site, add themes, plugins, custom code etc.

Site Migration

Local server to Local server

Method 1

  • This method does not use Git
  • Uses Local by Flywheel site export/import functionality
  • On local server 1
    • Export site using Local by Flywheel GUI
      • This will create {site_name}.zip export file
        • Export file contains, source files, media files and database
    • Upload file to Google Drive
  • On local server 2
    • Download export file from Google Drive
    • Import file using Local by Flywheel GUI

Method 2

  • This method uses Git

Local server to Production server

Initial Deploy

Method 1
  • Use All-in-One WP Migration plugin to export db, files, content, media
  • Don't like this method as it overwrites default site built by Bluehost
Method #2
  • Generate database dump
  • Create tarball for media files
  • Use SSH and git to transfer source files
⚠️ **GitHub.com Fallback** ⚠️