XFileSharing Pro - MFHS to XFilesharing migration

Message
Author
admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

MFHS to XFilesharing migration

#1 Postby admin » Sep 14, 2012 5:03 am

This tutrial will help you to migrate your files from MFHS to XFilesharing with redirecting old links to the new links.


AT FIRST! This mini tutorial will works perfectly if you was using url rewriting like "www.oldsite.com/en/files/442/blabla.html"

1 - Dump from your sql in a file : id, file, name, downloads from the table FILES

2 - Move files from the old folder /files into the new folder /cgi-bin/ImportedFiles

3 - Use the Import files function from you admin panel on your server list

4 - Dump file_name, file_code from the table Files of the xfs db

5- Find a way to rename all files with its real filename (from 3d42a213_1.rar to The_Real_Name.rar) thanks to the 2 dumps
For this step, I used a C# script i made to find the real name of a given file and to generate the correct update set sql..
I can share it for free if asked but it is customised for me, I can recode it..

6- Find a way to execute the update set sql that the script generated (something like : UPDATE Files SET file_name='The_Real_Name.rar' WHERE file_name='3d42a213_1.rar') (ssh, phpmyadmin etc..)

You can add the number of downloads to the request if you want.

7- All files are now imported with the correct name. To redirect all links with new links.
Find again a way to generate for all files on your dumps, 2 lines like :

RedirectMatch permanent /file/1/(.*) /qnluph835izw
Redirect permanent /file/1 /qnluph835izw

Those lines redirect the old link www.oldsite.ws/en/files/1/toto.html to www.oldsite.ws/qnluph835izw

Add, at the top those lines :
RedirectMatch permanent /(.*)/files/(.*)/(.*)$ /file/$2
RedirectMatch permanent /(.*)/files/(.*)$ /file/$2

Save all generated lines into your .htaccess root forum of your main server and all will works perfectly !

Thanks to the Guizmo who made this tutorial.