Author Archives: Meredith Fierro

Reclaim Cloud: Accessing Databases

Previously on Reclaim Cloud Learning; I talked through working with SSL certificates on the Cloud and Mattermost training, and now I’m going to be talking about working through databases to round out the Reclaim Cloud month. This one, in particular, surrounds accessing databases (like WordPress, or Mattermost) without the confirmation emails from Jelastic. I’ll walk you through getting access to the database node from your Cloud Dashboard without your database credentials. Reclaim Hosting uses this method on our support, so we don’t have to reach back to the user to see if they’ve saved the credential emails. It helps us save time going back and forth and getting to the root of an issue quicker.

After you install an application to your environment, say through WordPress or Mattermost, you’ll receive a few confirmation emails with passwords to various portions of the site. You’ll want to save these credentials but delete the email. You can use this method as well to access your node through Reclaim Cloud.

Accessing the Database Node

First, however, the biggest step is to access the database node within your browser. You can access this a number of ways, first by going to the URL and using the specific port number. So for instance WordPress you can use env-3224720.us.reclaim.cloud:8443

You can also access it through a node if it is a separate instance within your environment like node9764-env-2948928.us.reclaim.cloud, you can use this when working with PostgreSQL too for Mattermost.

Once you’ve loaded the URL you should see a login screen:

Locating Credentials

If you don’t have the credentials that were sent via email after the Jelastic, you can also locate the credentials within the site’s configuration files.

You’ll want to navigate to the file management system within your Cloud Dashboard, but you can also use WebSSH if you’d like. This will walk you through the file management system.

WordPress

For WordPress, you’ll want to work through your wp-config.php file within /var/www/webroot/ROOT/wp-config.php

Connection settings should look like this:

// ** Database settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘wp_7698727’ );

/** Database username */
define( ‘DB_USER’, ‘jelastic-6599005’ );

/** Database password */
define( ‘DB_PASSWORD’, ‘vsecurepassword’ );

/** Database hostname */
define( ‘DB_HOST’, ‘127.0.0.1’ );

/** Database charset to use in creating database tables. */
define( ‘DB_CHARSET’, ‘utf8’ );

/** The database collate type. Don’t change this if in doubt. */
define( ‘DB_COLLATE’, ” );

You’ll use the DB_USER and the DB_PASSWORD to access cPanel from there to access PHPMyAdmin.

Mattermost

Mattermost is just a bit different! Since this is using PostgreSQL, the location varies on the file. You’ll want to navigate to the /root/mattermost/congfig/config.jsonfile.

The username, password, and database name are located on the DataSource line under SqlSettings. Should look like:

“DataSource”: “postgres://webadmin:nky9FicDb4@sqldb:5432/mattermost?sslmode=disable\u0026connect_timeout=10”,

 

Once you’re logged in you’re good to go! You can make changes to the database like you would through the user interface, like changing a siteURL or homepageURL or grabbing an export of the database.


Featured Image: Photo by Henry Dick on Unsplash

Changing Your WordPress Theme from the Database

I wrote about changing your SiteURL and home page URL within your database if you’re working with a blank screen in WordPress, but I wanted to document what it looks like to change your WordPress theme from the database as well. I was working with users to set their site to the default WordPress themes if there was ever an error with the site. Say the theme was outdated and broke after an upgrade.

If your theme is wonky, you may see several different errors, a Critical Error in WordPress, an HTTP 500 Error, weird CSS on pages. If you have a Critical Error on your page or the HTTP 500 Error, you can also diagnose that within the error_log file within your cPanel. You may also lose access to your wp-admin dashboard to change the theme as well.

To start, you want to locate your database. This can be found within the wp-config.php file or within your Installatron instance for the site:

 

You’ll then want to navigate to PHPMyAdmin (I’m using cPanel in this instance).

 

Within the database, you’ll want to move to the wp_options table and locate the template and stylesheet. They typically are within the same lines as each other.

Next, you’ll want to locate the theme you’d like to change to. This is found in the wp-content/themes folder of the install. Any of the WordPress themes like twentytwentyone or twentytwentytwo will work. WordPress will default to these themes when working on an error.

 

Back in PHPMyAdmin, you can double click on the previous theme name and change it to the new theme.

Click out of the box and do the same for the template/stylesheet rows. Once changed your site should start to load again and you can begin to troubleshoot from there!