VirtueMart Forum

VirtueMart 2 + 3 + 4 => Installation, Migration & Upgrade => Topic started by: simonedev on March 30, 2020, 12:41:55 PM

Title: Migration from another domain fails
Post by: simonedev on March 30, 2020, 12:41:55 PM
Hi there.
I received the dump of the DB together with all Joomla e Virtuemart files.
I have no access to the original site, due to the old owner policy.

The old store url was something like this: http://www.old-domain/webshop/<lang>
My new (test) installation url should be like this: https://www.new-domain/subdomain/webshop/<lang>

I modified the configuration file, updating all DB, temp and logs data.

I also replaced all reference to the old domain inside the DB sql dump.

When I try to access the new site, I receive a message that looks like the link structure is not working fine.

These are my tests and results:

https://www.new-domain/subdomain/ --> blank page
https://www.new-domain/subdomain/webshop -->  jos-Error: Article not found
https://www.new-domain/subdomain/webshop/administrator --> jos-Error: Category not found

https://www.new-domain/subdomain/administrator --> page is shown but once I login I'm redirected again to the login page with no error messages

The .htaccess is present and identical to the one in the original package.

What's wrong?  ???
Title: Re: Migration from another domain fails
Post by: Studio 42 on March 30, 2020, 13:37:21 PM
QuoteThe .htaccess is present and identical to the one in the original package.
change or add
RewriteBase /subdomain/
Title: Re: Migration from another domain fails
Post by: simonedev on March 30, 2020, 14:50:58 PM
This is the content of my .htaccess
Is the one taken from the original site with 2 small variations (in bold)

##
# @package      Joomla
# @copyright   Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
# @license      GNU General Public License version 2 or later; see LICENSE.txt
##

##
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
##

## Can be commented out if causes errors, see notes above.
#Options +FollowSymLinks

## Mod_rewrite in use.

RewriteEngine On

## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.


## Begin - Custom redirects
#
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
#
## End - Custom redirects

##
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).
##

RewriteBase /ciocco/
#ciocco is my subdomain


## Begin - Joomla! core SEF Section.
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php

# and the request is for something within the component folder,
# or for the site root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC]

# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f

# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d

# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
## End - Joomla! core SEF Section.


The problem is the same than before. My 2 changes do not make any diference.
Title: Re: Migration from another domain fails
Post by: GJC Web Design on March 30, 2020, 17:01:29 PM
1st try it with SEF off and no .htaccess .. does it work?
Title: Re: Migration from another domain fails
Post by: simonedev on March 30, 2020, 17:17:48 PM
I renamed .htaccess file.
The only difference is that now a call to https://www.new-domain/subdomain/webshop/de makes a 404 page reponse.

I don't know how to turn SEF off.

I can add that I'm using Joomla 2.5.19 (the site is pretty old) but my server runs PHP 7.x . I read somewhere that it can be a problem...
Title: Re: Migration from another domain fails
Post by: AH on March 30, 2020, 18:26:39 PM
Get Joomla working first

You are migrating a Joomla site - that is using a VM component

Go to joomla forums for help - then - when you have it working - see if VM functions
Title: Re: Migration from another domain fails
Post by: Studio 42 on March 30, 2020, 23:33:44 PM
PHP 7 is perhaps the problem with Joomla 2.5
Title: Re: Migration from another domain fails
Post by: simonedev on April 02, 2020, 08:59:56 AM
Ok, there was a problem caused by PHP 7 .
Now I switched to php 5.6 and the site is on line... but not OK.

The test site is installed here: http://www.demopangea.it/de/

As you can see each product in home is made of 4 parts:
1. a photo, linked to the old and wrongaddress
2. a title, linked to the old and wrong address
3. a category, linked to the old and wrongaddress
4. a description, linked to the right address

Is there, maybe, a setting of virtuemart where I can set the right url?
Title: Re: Migration from another domain fails
Post by: Jörgen on April 02, 2020, 09:33:01 AM
Your slidexshow, has probably incorrect URL check the settings for this.

Jörgen @ Kreativ Fotografi
Title: Re: Migration from another domain fails
Post by: Studio 42 on April 02, 2020, 10:54:08 AM
Clear your cache.
Try to go in the module, if the Urls was not saved static and not relative.
Not that i get redirect to French and the site fails.
But if  admin is working , perhaps migrate to Joomla 3.9 + last Vm release give a better result.