Support

Admin Tools

#9800 Can ATP conflict with restoring a backup file?

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by nicholas on Wednesday, 18 May 2011 01:30 CDT

user29671
hello,

I'd like to know if the ATP component might have something to do with unexpected problems when restoring a backup file (taken with Akeeba Backup of course).

A couple of months ago I restored my site very easily. Now I just can't get it right; the ATP 2.0 component is the main difference between then and now.

At last I finally restored a very poor version of my site. So I deleted the .htaccess file and another file, think it was called Admin Tools.htaccess or something like that. With that, the frontend and the backend came out as they should.

Backend seemed to work fine, but in Frontend all links to the the rest of the site (sections, categories, articles) were broken. Their behavior was like this:
site: www.new_site.com
link: www.old_site.com/section/blablabla...

Of course, they produced a 500 Internal Server Error.

So I made a new .htaccess file and now some of the links work, but not all of them...

I will attempt a new restoration, but before I go with that, please tell me if ATP can interfere with the restoration procedure at some point, and if there's anything I can do to prevent it.

Thanks a lot for the great support.

nicholas
Akeeba Staff
Manager
The answer is yes and no.

No, ATP doesn't block or otherwise interfere with restoring your site - that's why it completed correctly. But, yes, it had everything to do with your problem. Admin Tools Professional's .htaccess Maker produces a .htaccess file which contains absolute URLs pointing to the original domain. In order to work around that, here's what you have to do:
1. Restore your site normally
2. Remove your .htaccess file from your site's root
3. Log in to your site's administrator back-end and go to Components, Admin Tools, .htaccess Maker
4. Expand the "System configuration" slider and edit the two "Host name for HTTPS requests" fields to read your new site location.
5. Click on "Save and create .htaccess" and you're set.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user29671
Hi, Nicholas, just a line to thank you for your reply. All is fine now.
Regards

nicholas
Akeeba Staff
Manager
You're welcome!

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user29671
Nicholas,

Sorry to come back with this subject.

Once again I tried to restore my site (just cloning it to see if it restored fine), and run again exactly into the same problem; that's why I'm taking back this thread.

The problem is that some articles' links work OK in the restored site; they show the new site's url, just like it should be.
But some articles don't. Their links keep the original site's url, so I get this:

"Forbidden
You don't have permission to access ( /section/category.html ) on this server.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request."
------

To solve this problem, I did what you told me before:

1. Restore your site normally
2. Remove your .htaccess file from your site's root
3. Log in to your site's administrator back-end and go to Components, Admin Tools, .htaccess Maker
4. Expand the "System configuration" slider and edit the two "Host name for HTTPS requests" fields to read your new site location.
5. Click on "Save and create .htaccess" and you're set.

But it didn't work.

The only thing I think might be wrong with my restoring process, is at the beginning, when you have the default location of directories Temporary, Logs, and Cache. In my case, both Temporary and Logs directories got a red "NO". Should I make them writeable at the original site? With 775 permissions, or 777?

Or is it something related to the .htaccess file?

All seem to work fine in this cloned site, except some articles' links.

---------
At this point I'm not sure if this is an ATPro topic, or if I should start a new thread in the AkeebaBackup forum; please let me know.

Thanks for your advice.

slaes
Xpard,

Under no circumstances should you ever have to set folder permissions to 777. You should steer clear of anything which requests such things. In fact if you have changed folders to 777, depending on your server config can cause server 500 errors. Be warned that anything which requires such permissions should be avoided at all costs. Otherwise unless you know exactly what your doing server wise (their are situtations however not recommended for many) you pretty much asking for trouble.

Make sure when you rewrite the new htaccess file everything under system configuration is correct, including the root directory. Also make sure in configuration.php you change the live site variable to reflect the new domain. exactly as http:// (no trailing / at end)

Are you running a SEF url component, such as SH404 or similar? If so, that will almost definately be an issue. You will need to purge ALL url's using that component.

Let us know how you go.

slaes
Just adding to the permissions thing, folders should NEVER EVER be set above 755 and files 644. Full Stop. This means any and all folders, temp, logs, cache etc. In fact if you want to go the extra mile, change to temp and logs folder to another name, eveyone knows the standard joomla ones.

Truth be told on a 110% perfect system, it would hardly matter. That setup is rather complicated and not really something to be discussed here. Certainly not something suitable to a shared host or someone who is not a gury on server linux setups.

A educated guess, i would say 99% of hacked sites are through, poor file permissions practices.

nicholas
Akeeba Staff
Manager
@both of you: Regarding permissions, I am against generalised aphorisms. Sometimes you can't avoid 0777 on shared hosts, e.g. when you want to have a backup output directory where we need to append to files (so the FTP mode is rendered useless). For detailed information on permissions, I suggest reading my "777: The number of the beast blog post from July 2010. Everything I say in there is still relevant (and will most likely continue to be for years to come!).

@xarpad The problem you have is not a restoration problem. The restoration came through just fine. The problem is how these articles are cross-linked to each other. If you copy a URL to an article it's an absolute URL, i.e. it contains the domain name. If you want to rewrite it on-the-fly to be relative to your [i]new domain[/i, i.e. your localhost, you can always use Admin Tools Core'sSEO and Link Tools and more specifically the "Link migration" feature. Just enter your live site's URL in the "Old locations" text area, check the "Enable link migration" option and you're done.

Regarding the 403 error you get when you try to access the live site's article, that is a bug with the .htaccess Maker in Admin Tools Professional 2.0.4 and earlier. Just upgrade to Admin Tools Professional 2.0.5 on your live site, go to .htaccess Maker and click on "Save and create .htaccess". The problem will go away. If that doesn't help, try installing the latest developer's release and do the same thing.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

user29671
Nicholas and Slaes,

Thanks very much for your help, all of what you both said was good information.

I tried the SEO and Link Tools and, just like Nicholas said, the problem was gone.

I'm still kind of newbie at Joomla, but have already tried many extensions --some of them really good extensions-- and don't know yet a single one that can compare to Akeeba's products. Plus, the quality of your support is great, especially for beginners like myself.

I will donate a few Euros in the coming days or will try to upgrade my subscription. I guess you Nicholas are the kind of person that doesn't think of money as the number one goal in life, but there's no doubt you deserve to earn lots of it.

Regards,

nicholas
Akeeba Staff
Manager
You're welcome! I am glad we could be of assistance :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!