- Visit [GitHub](https://github.com/tslocum/TinyIB) and review the changes made in the update.
- Ensure the update does not interfere with your changes.
Migrating
------------
TinyIB includes a database migration tool, which currently only supports migrating from flat file to MySQL. While the migration is in progress, visitors will not be able to create or delete posts.
1. Edit **settings.php**
- Ensure ``TINYIB_DBMODE`` is still set to ``flatfile``.
- Set ``TINYIB_DBMIGRATE`` to ``true``.
- Configure all MySQL-related settings.
2. Open the management panel.
3. Click **Migrate Database**
4. Click **Start the migration**
5. If the migration was successful:
- Edit **settings.php**
- Set ``TINYIB_DBMODE`` to ``mysqli``.
- Set ``TINYIB_DBMIGRATE`` to ``false``.
- Click **Rebuild All** and ensure the board still looks the way it should.
If there was a warning about AUTO_INCREMENT not being updated, you'll need to update it manually via a more privileged MySQL user. Run the following query for one or both of the tables, dependant of the warnings you were issued:
``ALTER TABLE (table name) AUTO_INCREMENT = (value to be set)``
if (isset($_POST['message']) || isset($_POST['file'])) {
if (TINYIB_DBMIGRATE) {
fancyDie('Posting is currently disabled.<br>Please try again in a few moments.');
}
list($loggedin, $isadmin) = manageCheckLogIn();
$rawpost = isRawPost();
if (!$loggedin) {
@ -262,6 +266,10 @@ if (isset($_POST['message']) || isset($_POST['file'])) {
fancyDie('Tick the box next to a post and click "Delete" to delete it.');
}
if (TINYIB_DBMIGRATE) {
fancyDie('Post deletion is currently disabled.<br>Please try again in a few moments.');
}
$post = postByID($_POST['delete']);
if ($post) {
list($loggedin, $isadmin) = manageCheckLogIn();
@ -348,6 +356,67 @@ if (isset($_POST['message']) || isset($_POST['file'])) {
$text .= '<p><b>TinyIB was not installed via Git.</b></p>
<p>If you installed TinyIB without Git, you must <ahref="https://github.com/tslocum/TinyIB">update manually</a>. If you did install with Git, ensure the script has read and write access to the <b>.git</b> folder.</p>';
$text .= '<p><b>Warning:</b> Unable to update the AUTO_INCREMENT value for table ' . TINYIB_DBBANS . ', please set it to ' . ($max_id + 1) . '.</p>';
}
$text .= '<p><b>Database migration complete</b>. Set TINYIB_DBMODE to mysqli and TINYIB_DBMIGRATE to false, then click <b>Rebuild All</b> above and ensure everything looks the way it should.</p>';
} else {
fancyDie('Bans table (' . TINYIB_DBBANS . ') already exists! Please DROP this table and try again.');
}
} else {
fancyDie('Posts table (' . TINYIB_DBPOSTS . ') already exists! Please DROP this table and try again.');
}
} else {
fancyDie('Please install the <ahref="http://php.net/manual/en/book.mysqli.php">MySQLi extension</a> and try again.');
}
} else {
fancyDie('Set TINYIB_DBMODE to flatfile and enter in your MySQL settings in settings.php before migrating.');
}
} else {
$text .= '<p>This tool currently only supports migration from a flat file database to MySQL. Your original database will not be deleted. If the migration fails, disable the tool and your board will be unaffected. See the <ahref="https://github.com/tslocum/TinyIB#migrating"target="_blank">README</a><small>(<ahref="README.md"target="_blank">alternate link</a>)</small> for instructions.</a><br><br><ahref="?manage&dbmigrate&go"><b>Start the migration</b></a></p>';
}
} else {
fancyDie('Set TINYIB_DBMIGRATE to true in settings.php to use this feature.');