XF 2.1 Question regarding vb4 imported images and new XF requests to them

gerryvz

Well-known member
On my old vB 4.2.4 install, I had an add-on that automatically downloaded and stored all linked images in posts, modded the post to direct it to the stored image, and stored them in a directory on the server.

This is so linked images that eventually were removed or changed, wouldn't get lost.

After my import to XF, the posts from the old forum that had the linked images changed to downloaded/stored images, still want to go to the old forum and download the image, where it is proxied on my XF server. Which is fine, but it means I can't redirect the old domain from the vB forum, because it breaks the request to get the stored images from that server.

As part of the migration, I also migrated all of these stored images to the new server (they are idle now), saving the file structure as it was on the old system.

Is there any way I can create a mod or re-direct either in XF, or on my server, to intercept requests to the old domain and stored images, and redirect to the same file on the new server?

Any help is appreciated.

Thanks
Gerry
 
You would have to implement a redirect rule on the originating server.

If the IDs are the same then it will be a simple rule.
If the IDs are different then you will need a script and a lookup table.
 
You would have to implement a redirect rule on the originating server.

If the IDs are the same then it will be a simple rule.
If the IDs are different then you will need a script and a lookup table.
the actual image IDs and the file structure would be the same.

Would this be part of the .htaccess file on the server for the old site?
 
Hmm I was going to look back at this Because I have the same situation, set up a new server with https on the same vpn . What I just discovered is the proxy cache is doing something similar to the import mod and I found I could set it to never expire , unsure if I have to open every thread for it crone or if its reliable or gonna make a huge fat spot of duplicity.

the url of the image looks like this https://mynew.app/proxy.php?image=http%3A%2F%2Folddomain.com%2Fforum%2Fimages%2Fimported%2F2018%2F10%2Fo_cook03-1.jpg&hash=7fb98c3202c61d59bfab26c89ceb2aba
 
That's what I've been doing in the short term ... letting people click on links and request the images, which are then proxied permanently on my new server.

It works well, but there are probably tens of thousands of images and I'm at about 4,000 images, so it will likely take some time to get all of them.
 
I've got about 17,000 images, and about 3,000 have already been requested and proxied. I'm going to take down my forum at a later date, but I'll leave the folder up for a while for future requests. I have all of the images on my new server, just haven't put the time into doing a redirect to them. The proxy setup seems to be working well, just will take time.
 
Using htaccess in the subfolder of my previous domain I was able to redirect all the links in BUT it broke the images and smiles at the new domain and the css at the remaining parts of the old domain.

I used what I was told of, and figured out how to add additional files it ignored , BUT i was not told how to ignore other files and folders
RewriteEngine On
RewriteRule ^(content.php|arcade.php|blog.php|v3arcade_vbsuite_index_compatibility.php).*$ - [S=1,L]
RewriteRule ^(.*)$ https://new domain.app/$1 [R=301,L]

got any Ideas ? I have no Idea what any of that acually does, I tried to add a |*.css to the 1st rule but it broke everything
 
I worked with @Jake Bunce on this via a support ticket, in combination with another issue I was having with redirects.

Here are the instructions and code that Jake provided, which worked seamlessly.

Note the following prerequisites: I copied over all of the imported images from the old vBulletin forum to the new server where my XF 2.1 install is done. I maintained the same file names and structure, but put them in a new "imported" sub-folder in the "data" folder of my XF install. Permissions on this "imported" folder and contents is 777.

Jake then instructed me to change the name of the "imported" images folder on my old vB server to something like "imported_bak" -- which I did.

Then he provided me this code, which is placed in an .htaccess file in the directory of the vB install where the renamed "imported_bak" file resides (in my case it was www.oldforum.com/forums/images).

Code:
RewriteEngine On
RewriteRule ^(imported/.+)$ https://www.NEWFORUM.COM/forums/data/$1 [R=301,L]

The "forums/data" after newforum.com in the URL above should be the directory on the XF server where the XF installation is done and where the imported images folder resides on the XF server.

Worked immediately and seamlessly for me. I can't thank Jake enough for his help. As a stat, in the month since I moved over from vB to XF, I've had just over 7,000 of the nearly 18,000 images proxied on the new XF server. They are coming over at a rate of a couple hundred images a day, as they are requested.

I hope this helps.

Cheers,
Gerry
 
Last edited:
I worked with @Jake Bunce on this via a support ticket, in combination with another issue I was having with redirects.

Here are the instructions and code that Jake provided, which worked seamlessly.

Note the following prerequisites: I copied over all of the imported images from the old vBulletin forum to the new server where my XF 2.1 install is done. I maintained the same file names and structure, but put them in a new "imported" sub-folder in the "data" folder of my XF install. Permissions on this "imported" folder and contents is 777.

Jake then instructed me to change the name of the "imported" images folder on my old vB server to something like "imported_bak" -- which I did.

Then he provided me this code, which is placed in an .htaccess file in the directory of the vB install where the renamed "imported_bak" file resides (in my case it was www.oldforum.com/forums/images).

Code:
RewriteEngine On
RewriteRule ^(imported/.+)$ https://www.NEWFORUM.COM/forums/data/$1 [R=301,L]

The "forums/data" after newforum.com in the URL above should be the directory on the XF server where the XF installation is done and where the imported images folder resides on the XF server.

Worked immediately and seamlessly for me. I can't thank Jake enough for his help. As a stat, in the month since I moved over from vB to XF, I've had just over 7,000 of the nearly 18,000 images proxied on the new XF server. They are coming over at a rate of a couple hundred images a day, as they are requested.

I hope this helps.

Cheers,
Gerry
thanks Gerry, Jake was able to help me as well using an add on. I was able to move the folder over to the new server and using a different method, At first I didn't think it was working as the massive number of links timed out the search, however on a hunch with a backed up sql i checked the phpadmin and found that when I checked the save option it processed about 3000 entries, so I did it a couple of times finding that the second and third run got through a lot more each and with 3 runs it processed all 15674
this add on https://xenforo.com/community/resources/post-content-find-replace.5748/
these settings.
200808
hope this helps someone else looking for a solution. I liked the Idea my archived cached stayed separate from the new one and I was able to take away all the old references. I also used this to fix my media tags as that was its built for purpose.
 
Wow -- that's a great way to do it !! I didn't know about that mod -- probably would have done it that way. Congrats !!

I do think I will use it to fix old BBcode tags that I had for youtube videos, though.
 
Back
Top Bottom