Changing the folder and database associations

Paul Barrett
Posts: 68
Joined: Sun Apr 08, 2018 6:52 pm

Changing the folder and database associations

Post by Paul Barrett »

I have two TNG installation, a live and a dev site. There was something odd in the way a few aspects of the live site worked culminating in a white screen of death when a couple of admin_updatexxxxx files refused to load. None of these issues existed on dev, so I decided that the best course of action was to change the web station virtual hosts to switch the live URL to point to the dev instance an vice versa.

So far so good but we now have the situation where the folders and data base for the two instances don't reflect the actual URLs which is a recipe for future disaster. What steps would I need to take to rename them? In fact, I will delete the dev instance because it doesn't work. Better to reinstall that one from scratch to eliminate the gremlins.
Steve
Posts: 130
Joined: Sun Oct 01, 2017 3:08 pm

Re: Changing the folder and database associations

Post by Steve »

If you are using TNG, without WordPress, go to the config.php file and change $rootpath = to the new absolute folder name. On a Synology this will include the volume name and the complete folder path.

Then ensure $tngdomain = is the correct URL. If this is not correct you will have admin problems out the kazoo.

As far as the database goes I'm not sure what you mean. The database name has nothing to do with the virtual host name or the TNG folder name. As long as TNG has the correct database name and credentials it will connect.
Paul Barrett
Posts: 68
Joined: Sun Apr 08, 2018 6:52 pm

Re: Changing the folder and database associations

Post by Paul Barrett »

The folder and database names were tng_live and tng_dev, hence the potential confusion.

But it's moot mow. So many unrelated issues started to emerge that I blew the whole live site away and reinstalled them from scratch
Steve
Posts: 130
Joined: Sun Oct 01, 2017 3:08 pm

Re: Changing the folder and database associations

Post by Steve »

In the future you can change database names using phpMyAdmin. To change the name select the database and then select the operations tab.

Image

Type in the new database name and check the Adjust privileges box. The old user name will be applied to the new database. Then click the Go button on the right side (not shown in the pic).
A notice will appear asking to confirm creating the new database and dropping the old one.

Image

Select OK.

Now the old database is copied to the new database name and the old one is deleted. The old user name is now assigned to the database. If you want the user and database names to match, select edit privileges.

Image

Another screen appears for the old user name. To change the name select Login information

Image

Type in database name or whatever name you want to use.
You can change the password or use the password from the old user name. (Note this may require changing the password to add special characters for security requirements)
Write down the user name and database password as you will need it to connect TNG to the database.
Select the radio button to delete the old user account unless you are assigning it to another database.
Select Go.

Image

When finished check the privileges to ensure everything is correct.

Image

If the name and password has changed for TNG, open the TNG config.php file and enter the new information.