This is an experiment that I decided to make today to import likes from this addon to XF2.1.
WARNING!! THIS IS AN EXPERIMENT AND THE CODE IS NOT FULLY TESTED. YOU SHOULD ONLY RUN IT ON A TEST BOARD OR AFTER MAKING A FULL BACKUP OF YOUR SITE.
It will try to import content from two tables:
dark_postrating_ratings: which includes the Title, Image URL, Display Order, Sprite Dimensions and Positions and Rating Type.
dark_postrating: which includes the actual ratings.
The titles of the imported reactions will have an 'Imported' suffix to help you identify them. It is highly recommended to close your forum before the import and edit the imported reactions afterwards to make sure everything looks good.
Instructions (read the whole post)
MAKE A FULL BACKUP OF YOUR SITE, THIS CODE IS AN EXPERIMENT.
The process is simple: Upload the file to the root of your forum and run it from your console (by running
php import_post_ratings.php in your SSH console). You can also try to open the script in your browser
but it will probably timeout unless you increase the PHP timeout limit. The script can take several minutes depending of the size of your database. Mine took like 10 minutes to import ~75k likes.
The final output should be something like:
76341 reactions imported. 300 errors.
If it does't show this at the end of the output it means that something happened and the script was terminated. This is why it is recommended to try it first on a test site or after making a full backup of your forum.
(The reported errors are usually deleted posts that doesn't exist in the database.)
Once the script is done check that the reactions were imported successfully and please report any problem you may have encountered. I will try to fix them for you.
IMPORTANT NOTE: you cannot run this script twice in the same database. It will reimport reactions and you will end up with duplicated likes. If something goes wrong, restore your database backup and try again.
Custom request and Import Services.
If you want me to perform the import for you or if you need a specific modification to this script, feel free to contact me and request a quote.
Feedback is always welcome.