Now that the new database is imported, we need to make 2 changes to it to match your environment. Please select the environment that matches your new MindTouch install:
(The following commands are run from the MySQL prompt) Once logged into MySQL make sure you run the following to choose the MindTouch database:
Windows
Check to see if the row exists:
Select config_key from config where config_key="storage/fs/path";
Select config_key from config where config_key="storage/type";
This will return the following if it exists:
+-----------------+
| config_key |
+-----------------+
| storage/fs/path |
+-----------------+
1 row in set (0.06 sec)
+-----------------+
| config_key |
+-----------------+
| storage/type |
+-----------------+
1 row in set (0.06 sec)If the row does exist run the following:
(note: location of attachments may vary, please confirm before updating the highlighted value below)
update config set config_value="C:\Program Files\MindTouch\MindTouch\data\files" where config_key="storage/fs/path";
update config set config_value="fs" where config_key="storage/type";
If the row doesn't exist run the following:
Can you try and run the following from the MySQL command line prompt:
INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','C:\Program Files\MindTouch\MindTouch\data\files');
INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');
Linux
Check to see if the row exists:
Select config_key from config where config_key="storage/fs/path";
Select config_key from config where config_key="storage/type";
This will return the following if it exists:
+-----------------+
| config_key |
+-----------------+
| storage/fs/path |
+-----------------+
1 row in set (0.06 sec)
+-----------------+
| config_key |
+-----------------+
| storage/type |
+-----------------+
1 row in set (0.06 sec)If the row does exist run the following:
(note: location of attachments may vary, please confirm before updating the highlighted value below)
update config set config_value="/var/www/dekiwiki/attachments" where config_key="storage/fs/path";
update config set config_value="fs" where config_key="storage/type";
If the row doesn't exist run the following:
Can you try and run the following from the MySQL command line prompt:
INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','/var/www/dekiwiki/attachments');
INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');
The problem is at the step where I am asked to "Check to see if the row exists" by issuing this SQL statement: "Select config_key from config where config_key="storage/fs/path";
In my case I found that this select matches no rows, so I followed the branch of the instructions for the case where the row doesn't exist. These instructions are specifically to run these sql commands:
INSERT INTO config (config_key, config_value) VALUES ('storage/fs/path','/var/www/dekiwiki/attachments');
INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');
The problem is with the 2nd INSERT INTO... It happens that this table already has a row where config_key='storage/type' but 'config_value'='s3' (apparently from importing the wikidb.sql file from the wik.is dump tarball I recieved).
The INSERT INTO adds another row where config_key='storage/type' but 'config_value'='fs'. When you later run php update-db.php, the update script detects the 'config_value'='s3' instead of 'config_value'='fs' and it fails to move and rename the files in the attachment directory properly. The new wiki will appear to work, but the links to attachment files do not work because they were not migrated properly by the update-db.php script.
The fix is to add a step where you check for the existence of the config_key="storage/type" entry and use the update instead of the insert command if it exists to prevent duplicates that breaks the migration script.
EG:
Check if row exists using this command: Select config_key from config where config_key="storage/type";
If it does exist, use this command:
UPDATE config set config_value="fs" where config_key="storage/type"; and not the command
If it does not exist, use this command:
INSERT INTO config (config_key, config_value) VALUES ('storage/type','fs');
This modification resulted in a working wiki migration for me.