- As with any upgrade, it is recommended to make a backup of your current
logs
directory (andimages
, if you are using custom images). - v6 uses different files (
.json
instead of.txt
), and stores data differently (as json data instead of plain text), than versions <=5.0.1- The default counter images are also different, and are PNG images instead of GIF images.
- You can upgrade using composer, though you would need to update your
composer.json
first to change the version constraint from^5.0
to^6.0
. Then:
composer update
- A script is provided at
scripts/convertFiles.php
that can update the counter and log files to the new format.
php -f scripts/convertFiles.php
Before running the script, you'll need to edit it to make sure it is pointing to the proper location of the counter files:
// Update the location to your current log files, if needed.
$oldCounterFile = \dirname(__DIR__) . '/counter/counter.txt';
$oldIpFile = \dirname(__DIR__) . '/counter/ips.txt';
// Update the location where the new files will be placed, if needed.
$newCounterFile = \dirname(__DIR__) . '/counter/counter.json';
$newIpFile = \dirname(__DIR__) . '/counter/ips.json';
- See Usage for more details on how to update your calls to, or instantiation of, the counter library.
- Make a backup of your current
logs
directory (andimages
, if you are using custom images).- Your directories are most likely
counter/logs
andcounter/images
since that was the default way to install/setup SimpleCounter prior to v5 1 - This is the default in v5 as well, so if you follow installation and copy the
counter
folder to your webroot, it will overwrite your old data, so backups are key.
- Your directories are most likely
- Install SimpleCounter v5 through composer.
- Copy your
ips.txt
andcounter.txt
files that you backed up to the new locations. - Update your site/project on how you call the counter, see usage.