Lot of us love to have DISQUS comments on our sites. It's one of those hosted commenting systems that adds virality to all content and comments on your site. Techjoomla uses DISQUS too, and during our recent site upgrade we had a challenge ensuring that our comments get carried over since the migration meant that the links/URLs to all our pages got changed. We were really glad that we chose DISQUS, since they have some really useful tools for migrating comments when changing URLs.
We wrote a neat little script that could read the export file that DISQUS generates and find out the 404s. Then we added these 404 links as aliases to the correct SEF URLs. Re-ran the script to get a mapping file that could be uploaded to DISQUS. Done!
Here are detailed steps along with links to resources to get the job done!
- Allowed the SEF URLs to get generated on the new site
- Exported a list of our discussions from DISQUS (See how)
- Ran a script to find out which of these go to a 404 (Get the script)
- Added the 404 URLs as aliases to the respective correct URLs using sh404
- Ran the script again to generate the 'URL mapping' file that is needed by DISQUS to migrate the comments
- Upload the CSV file at DISQUS, and within 24 hours your discussions should start showing up on the new URLs
Another important thing that you need to ensure during migration is the uniqueness of your comments. You will be using either the disqus_url or disqus_id for this. It's worth noting here that in case of disqus_url, the http and https variants of the same page are treated as separate threads by DISQUS. You will need to ensure only one or the other is used.
Unfortunately there's no way to do a similar thing with Facebook, Twitter & G+ , if you've been in a similar spot and have been able to migrate your likes, we'd love to hear!