TNG is Corrupted - What do I do now?
Posted: Mon Mar 21, 2022 1:50 pm
TNG is a great program that can be customized in many ways. Most often customization is made using mods but there are times users modify the code as well. The TNG mod manager is written to analyze, implement changes and minimize problems when making code modifications. The biggest problem I've encountered is when someone updates. If the mod is deleted before uninstalling, code fragments are left scattered in various TNG files.
The procedure below will help recover using TNG core files. Keep in mind if you corrupted the database, that is another matter and this article will not help. If restoring the database from a backup is not possible, you might need start over and do a full install.
If you are updating, writing a mod or modifying code and make a mistake, TNG may become completely disabled. At times you may be able to manually correct the error but if many changes were made that may be difficult. Most of time the culprit is a corrupted PHP or script file.
The easiest way to get TNG going is replace the TNG core files. To accomplish this task, create a rebuild zip file. This lets you easily replace the files most likely to have been corrupted by a mod or bad coding. Note this method deals with the core files so if you corrupted the config.php file, it will have to be repaired manually.
To create a rebuild zip file, unzip the original files to a temp folder. Remove the backup folder, documents, headstones, histories, img folder, photos and ALL media folders, the mod folder and config.php. Removing config.php is critical because if you overwrite the existing config file TNG will not connect to the database and you cannot log in. In some cases you can remove the famconfig.php, importconfig.php, mapconfig.php and timelineconfig.php files but it's best to replace them because the configuration settings are easy to change.
After the folders and files have been deleted from the temp folder, create a compressed ZIP of the remaining folders and files. Give the ZIP file a unique name like TNG13.1.1-Core or TNG13.1.1-Rebuild.
Then take TNG offline and, if possible, uninstall all mods. If you cannot uninstall the mods or access the admin pages don't worry as replacing the core files nearly always fixes this issue. Upload the folders and files from the newly created ZIP file overwriting any existing files and folders. When you return TNG should start and run normally. You can cleanup/re-install the mods, except the one that created the error, and everything should be back to normal.
I've used this procedure and saved hours reinstalling and configuring TNG.
The procedure below will help recover using TNG core files. Keep in mind if you corrupted the database, that is another matter and this article will not help. If restoring the database from a backup is not possible, you might need start over and do a full install.
If you are updating, writing a mod or modifying code and make a mistake, TNG may become completely disabled. At times you may be able to manually correct the error but if many changes were made that may be difficult. Most of time the culprit is a corrupted PHP or script file.
The easiest way to get TNG going is replace the TNG core files. To accomplish this task, create a rebuild zip file. This lets you easily replace the files most likely to have been corrupted by a mod or bad coding. Note this method deals with the core files so if you corrupted the config.php file, it will have to be repaired manually.
To create a rebuild zip file, unzip the original files to a temp folder. Remove the backup folder, documents, headstones, histories, img folder, photos and ALL media folders, the mod folder and config.php. Removing config.php is critical because if you overwrite the existing config file TNG will not connect to the database and you cannot log in. In some cases you can remove the famconfig.php, importconfig.php, mapconfig.php and timelineconfig.php files but it's best to replace them because the configuration settings are easy to change.
After the folders and files have been deleted from the temp folder, create a compressed ZIP of the remaining folders and files. Give the ZIP file a unique name like TNG13.1.1-Core or TNG13.1.1-Rebuild.
Then take TNG offline and, if possible, uninstall all mods. If you cannot uninstall the mods or access the admin pages don't worry as replacing the core files nearly always fixes this issue. Upload the folders and files from the newly created ZIP file overwriting any existing files and folders. When you return TNG should start and run normally. You can cleanup/re-install the mods, except the one that created the error, and everything should be back to normal.
I've used this procedure and saved hours reinstalling and configuring TNG.