SOLVED Transfer Tool didn't copy .htaccess

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi,

I have transferred 3 accounts from one server to another but the public_html/.htaccess was not copied.

So, this files doesn't exist in the new server and in the old server it exists and has this new line at the end:
Code:
RedirectMatch \.(dynamiccontent|pl|plx|perl|cgi|php|php4|php5|php6|php3|shtml)$ http://server.xxxxx.com/cgi-sys/movingpage.cgi
I never saw this problem.

What could be wrong? Why this file was not copied to the new server?

Is there anything else missing from the transfer? I'm afraid that other files could be missing or have other problems.

Thanks
Nuno Leite
 

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi,

Just to add that i have made a transfer of 1 account in 6/8/2019 still with cPanel 80 and it worked fine, and now this was done with cPanel 82 on both servers, 3 accounts at the same time.
Is it some bug because there where concurrent transfers?
Or is a bug just for cPanel 82?

Thanks
Nuno Leite
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello @nunoleite

Is anything noted in the transfer log in regard to the .htaccess file during the restore/transfer? There is no known issue related to this at this time.
 

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi,

On the Transfer site:
Code:
...
[2019-08-20 19:55:26 +0100] Copying homedir.............
[2019-08-20 19:55:28 +0100] Done
[2019-08-20 19:55:28 +0100] Fixing up EA4 .htaccess blocks: /home/conta/public_html/.htaccess  Done.
[2019-08-20 19:55:28 +0100] Performing “Postgresql” component....
[2019-08-20 19:55:28 +0100] Completed “Postgresql” component.
...
On the Restore side there is this:
Code:
...
BackupConfig
    Restoring backup config …
        Updated backup config for “conta”.
    Restoring legacy backup config …
        Updated legacy backup config for “conta”.
    BackupConfig
Unsuspend
    Unsuspending .htaccess files for domains conta.com.
    Unsuspend
PublicHtmlSymlinks
    PublicHtmlSymlinks
...
SSL
    The SSL certificate is now installed onto the domain “conta.com” using the IP address “xxx.xxx.xxx.xxx”.
    SSL
Htaccess
    Htaccess
        EasyApache4 was repaired in .htaccess files.
WebDiskHomedir
    WebDiskHomedir
...
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
@nunoleite

For both of the issues regarding the transfer tool can you please open a ticket using the link in my signature? Once open please reply with the Ticket ID here so that we can update this thread with the resolution once the ticket is resolved.


Thanks!
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello,

Checked in on this ticket today and found that the analyst discovered the .htaccess files that were not moved were owned by the root user. Only files owned by your user will be migrated using the transfer tool. If you do run into this behavior again without the files being owned by root please do contact us again in regard to this and we'll look further into it.

Thanks!
 

nunoleite

Well-Known Member
Jun 4, 2007
68
4
158
Hi,

Yes, that's correct.

It's strange that file changed to owner root instead of the user, but i will be aware in future situations.

Thanks.
 
  • Like
Reactions: cPanelLauren

masamia

Member
Nov 24, 2019
6
0
1
Kazakhstan
cPanel Access Level
Root Administrator
I confirm that there is a problem moving the .htaccess file. I have a server with cPanel v78.0.44. Now I am transferring about 70 accounts from it to another server with cPanel v84.0.14. If the .htaccess file contains a block of lines:

Code:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
then the file is not copied to the new server. Moreover, commenting out this block does not help - the file is still not copied. It is necessary to delete this block and then the file will be copied.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
You should not remove any block of lines in the .htaccess - what if anything is noted in the transfer logs? What is the permissions/ownership of the .htaccess file intially?
 

masamia

Member
Nov 24, 2019
6
0
1
Kazakhstan
cPanel Access Level
Root Administrator
I created a new empty tst.local account for verification. In the public_html directory I created the .htaccess file:

Code:
[email protected] [/home/tst/public_html]# ls -Fla
total 16
drwxr-x---.  3 tst nobody 4096 Nov 28 10:54 ./
drwx--x--x. 12 tst tst    4096 Nov 28 10:55 ../
drwxr-xr-x.  2 tst tst    4096 Nov 28 10:54 cgi-bin/
-rw-r--r--.  1 tst tst     297 Nov 28 10:50 .htaccess
[email protected] [/home/tst/public_html]#
[email protected] [/home/tst/public_html]# cat .htaccess
Options -Indexes

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php56” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php56 .php .php5 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
[email protected] [/home/tst/public_html]#
I copy the account to another server. Here is the result of copying:
Code:
TRANSFER: 1 completed, 0 had warnings, and 0 failed.
RESTORE: 1 completed, 0 had warnings, and 0 failed.
Here is the contents of the public_html directory on the recipient server after the transfer:
Code:
[[email protected] public_html]# ls -Fla
total 12
drwxr-x---  3 tst tst 4096 Nov 28 10:54 ./
drwx--x--x 15 tst tst 4096 Nov 28 10:59 ../
drwxr-xr-x  2 tst tst 4096 Nov 28 10:54 cgi-bin/
[[email protected] public_html]#
Here are the entries in the transfer log regarding the .htaccess file:
Code:
[2019-11-28 10:59:15 +0600] Fixing up EA4 .htaccess blocks: /home/tst/public_html/.htaccess Done.
Here are the entries in the restore log regarding the .htaccess file:
Code:
Unsuspend
  Unsuspending .htaccess files for domains tst.local.
  Unsuspend
Htaccess
  Htaccess
    No need to update htaccess files.
 
Last edited:

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
Hello,

does the new server have php 5.6 installed? There was a case for v76 that if the php version didn't exist on the destination server the .htacess wouldn't be transferred, though this should have been resolved in v76. There is also a case that was resolved in v80 that indicates that some errors on restoring files were silently ignored as well.

Thanks!
 

masamia

Member
Nov 24, 2019
6
0
1
Kazakhstan
cPanel Access Level
Root Administrator
Yes - ea-php5.6 is installed on both servers. Yesterday I performed the same experiment on two other servers with cPanel v84.0.16 and ea-php5.6 installed on both servers - the .htaccess file was not copied. This doesn’t bother me much - I just copy the .htaccess file manually later. But it looks like a bug.
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,301
363
Houston
As I mentioned in my last response, I was curious if it was one of 2 things. I believe it is the later case that you're experiencing. This issue is resolved in v80 of cPanel/WHM and in the meantime the workaround would be to do as you've done already.


Thanks!