I have not found a way to fix the 504 error but I've found two methods to avoid it. The first method is change the backend to NGINX during the import. If you have a stand alone TNG installation and don't have redirects or something using Apache, it works fine. If you are using WordPress with TNG, it causes a problem because WordPress uses Apache for rewrites. When using NGINX, WordPress will not find any posts or pages. You can add code to NGINX so WordPress functions, but any redirects or other Apache functions will be lost. I'm not sure why, but flipping the backend back and forth seems to cause issues once in a while that requires rebooting the NAS.
The second method, which I use, does not cause problems and seems to be more reliable even when using WordPress. It involves using a virtual host for the internet website and a second TNG installation with local access only. Note if you use a CMS with TNG, it should be installed in a sub-folder, not the web folder. If you run any program in the web folder, which is the "root" for a Synology NAS, visitors may be able to access folders that you intended to be private.
Web Station's General Settings default should be configured for NGINX. Then the virtual host can be configured for the internet version of TNG, WordPress, Joomla etc. using Apache. However you should never have two programs accessing the same database at the same time. If you put the public version of TNG in maintenance mode, you can use a local version to import or export a GEDCOM.
While Darrin doesn't require a second license for running a local version, I'm sure he would appreciate a contribution for all his hard work. He doesn't charge much for the software to begin with, and it's a lot of work keeping everything up to date.
To create the second installation, use DSM and create another TNG folder inside the web folder. You can name this folder whatever you like but I prefer something simple and easy to remember like tngimport. Copy the TNG ZIP file to the new folder and extract the files using DSM File Station. This will set TNG permissions correctly.
Instead of running the TNG setup readme.html file, copy the config.php file from your existing TNG installation to the new tngimport folder. Go to the tngimport folder and open the config.php with an editor that does not use BOM (Byte Order Mark) formatting like Komodo IDE or Notepad++. Alternately you can download and use the Synology text editor available in the package center. Scroll down to the $rootpath about line 54. The line will look something like:
Code: Select all
$rootpath = "/volume1/web/genealogy/";
Code: Select all
$rootpath = "/volume1/web/tngimport/";
Click on the active LAN and you will see the address:
Go back to config.php file and scroll down to the $tngdomain variable about line 58.
Code: Select all
$tngdomain = "http://mydomain.com";
Code: Select all
$tngdomain = "http://192.168.1.xxx/tngimport";
Code: Select all
192.168.1.xxx/tngimport
Go to the admin section and set up import preferences such as the Default Replace Option, Change Date, living etc. Then import or export the GEDCOM normally. If you performed an import, don't forget to select the Secondary Processes tab and then Select Track Lines. This will add the plus sign back to families with children. When the import is complete turn off the maintenance mode, if it was enabled, log out and close the browser tab. Return to the TNG internet public version and turn maintenance mode off.