Reminder to check database name in config.php before upgrade

xml

Active member
actually this happen to me today when upgrading from test beta3 to test beta4 and it happend to me in the past when upgrading vB forums and am sure it keeps happening to alot of forums admins.

for new installation there is no problem but since upgrading xenforo require you upload the new folders and files over the exisiting one in the xen root folder someone might forget to change the database name in the config.php to the name of new test database which would result upgrading the production database by mistake and God help if you didnt make a backup.

so i suggest in the upgrade script start page there should be an input box to edit if needed the name of databse in config.php which you want to be upgraded or at least a red color text reminder to check database name in config.php before running the upgrade, that way no one will forget if his database name need to be changed or not
 
Are you saying you had to manually edit the config.php file to complete the upgrade?

Make sure you check the upgrade package for an existing installation.

package.webp
 
No Borgan.

when i do upgrade i stay a way from the live databse.
i just make a new databse with restored copy of the live database and run the upgrade on the new database.
on my case i forgot to change the database name in the config.php from the live DB to the new DB so the upgrade ran on the live DB. if somthing goes wrong i will loose my live DB
 
So if I'm to understand correctly, you upload the new files onto your live server directory but then manually edit the config.php file to run the upgrade on a test database?

Surely overwriting the live server files also has risk attached to it?
What happens if you have to backout? You will have to upload all the old files to your server.

Why not just have a completely separate environment for your test and live installations?
Both directories and databases?
 
Why not just have a completely separate environment for your test and live installations?
Both directories and databases?

the upgrade instruction said:
To upgrade an existing XenForo installation, you will need to extract the zip and upload all files within the upload directory to your existing XenForo Directory, overwriting all files.

so to simulate the instruction i copied all folders and files of a currunt comunity xen3 including config.php to a newly ctreated folder of name xen4 then i uploaded the all files of the upgrade package to xen4 overwriting all exisiting files

i did that becouse i am not sure if the upgarde package include all files OR only the changed files from beta3 to beta4

now i will run the upgarde process on xen4 folder

BUT inside xen4 folder there is:
1. config.php of live DB details copied from xen3
2. confing.php.default with no details copied from the upgrade package

when i run the upgrade script on xen4 folder, the script will see config.php which contains the details of the live DB and then run the upgrade on it.

i was planing to edit config.php to direct the upgrade to the test DB not the live DB , but i forgot :)
 
The upgrade instructions relate to any installation, be that your live, test or local installation.

The config.php.default file is included with both the full and upgrade packages.

What you did was essentially correct, all you omitted was the step to edit the config.php file in your new test/xen4 directory to point to your test database.

If you now leave that test folder in place, there will be no need to do anything next time.
The details in the config.php file will in future point to your test database.

Apart from avatars and attachments, all data is stored in the database so there is no need to copy the live directory to the test directory in future as all the files will be identical as they are now both at Beta 4.

If you want to make your test database/directory completely reflect your live site for the next upgrade, just copy the data and internal_data directories and import the live database to your test DB.
Then you can run the upgrade on your test installation and if it works, repeat the process on your live installation.
 
No problem but just be aware you don't really need to copy the data and internal_data directories.
You can just copy the live DB to your test DB, just attachments and avatars will be missing.
 
the upgrade instruction said:
To upgrade an existing XenForo installation, you will need to extract the zip and upload all files within the upload directory to your existing XenForo Directory, overwriting all files.

so to simulate the instruction i copied all folders and files of a currunt comunity xen3 including config.php to a newly ctreated folder of name xen4 then i uploaded the all files of the upgrade package to xen4 overwriting all exisiting files

i did that becouse i am not sure if the upgarde package include all files OR only the changed files from beta3 to beta4

now i will run the upgarde process on xen4 folder

BUT inside xen4 folder there is:
1. config.php of live DB details copied from xen3
2. confing.php.default with no details copied from the upgrade package

when i run the upgrade script on xen4 folder, the script will see config.php which contains the details of the live DB and then run the upgrade on it.

i was planing to edit config.php to direct the upgrade to the test DB not the live DB , but i forgot :)


Yea, but it does not say: copy the db and do a live test upgrade first ..

The upgrade instructions adapt to your personal situation obviously ..
 
Top Bottom