doonfrs / transfer-cyberpanel-server

9 stars 2 forks source link

No working getting PHP Parse Error #1

Open ariyandnath opened 1 week ago

ariyandnath commented 1 week ago

I am getting this error on running ./migrate.sh PHP Parse error: syntax error, unexpected ':', expecting ')' in /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php on line 136

My server details Ubuntu 22.04 Location - Germany Provider - Hetzner

ERROR IMAGE ATTACHED image

doonfrs commented 1 week ago

Hi, you must use php 8, please check php --version to set php 8.1 as default:

rm /usr/bin/php
ln /usr/local/lsws/lsphp81/bin/php /usr/bin/php
ariyandnath commented 1 week ago

root@ubuntu-16gb-fsn1-1:~# cd transfer-cyberpanel-server/ root@ubuntu-16gb-fsn1-1:~/transfer-cyberpanel-server# ls config.ini config.ini.template migrate-scripts migrate.sh README.md root@ubuntu-16gb-fsn1-1:~/transfer-cyberpanel-server# ./migrate.sh


1 - Please make sure that you are running as root or sudo.

2 - Please add rsync to the sudoers filein the remote server. In remote server shell type sudo visudo, and add the following line: root ALL=(ALL) NOPASSWD: /usr/bin/rsync Then save and exit.


if You are sure about that, type 'yes' and press enter: yes Running migrations... **Migrating websites**

SSH key-based authentication is not set up. Setting it up now... We are about to run ssh-copy-id to set up passwordless SSH access to 65.109.140.12. This will require your SSH password once. ssh-copy-id output: /usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/root/.ssh/id_rsa.pub" /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys

Number of key(s) added: 1

Now try logging into the machine, with: "ssh -o 'StrictHostKeyChecking=no' -p '22' 'root@65.109.140.12'" and check to make sure that only the key(s) you wanted were added. Failed to retrieve or parse websites list. **Migrating emails**

Failed to retrieve or parse websites list. **Migrating databases**

Failed to retrieve or parse websites list. **Migrating data**

Failed to retrieve or parse websites list. **Migrating vmail**

Migrating /home/vmail directory... Rsync completed successfully. Changing ownership to vmail:vmail for /home/vmail... PHP Fatal error: Uncaught ErrorException: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php:306 Stack trace:

0 [internal function]: {closure}()

1 /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php(306): trim()

2 /root/transfer-cyberpanel-server/migrate-scripts/05-migrate-websites-vmail.php(30): shellExec()

3 {main}

thrown in /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php on line 306

Check this.

doonfrs commented 1 week ago

hi 1 - are both servers running on Ubuntu 22? 2 - did you add rsync to sudoers?

ariyandnath commented 1 week ago
  1. Yes
  2. Yes.

And I have a question in which site I have to run the script.

My Cyberpanel websites and all data is in IP-A And the new fresh cyberpanel is in IP - B

ariyandnath commented 1 week ago

root@hispaads:~/transfer-cyberpanel-server# ./migrate.sh


1 - Please make sure that you are running as root or sudo.

2 - Please add rsync to the sudoers filein the remote server. In remote server shell type sudo visudo, and add the following line: root ALL=(ALL) NOPASSWD: /usr/bin/rsync Then save and exit.


if You are sure about that, type 'yes' and press enter: yes Running migrations... **Migrating websites**

Package Default already exists. Package admin_CORREOS already exists. Creating owner admin for server.hispaads.com. User admin already exists. Creating website for server.hispaads.com with owner admin. Website server.hispaads.com already exists. Creating owner admin for hispaads.com. User admin already exists. Creating website for hispaads.com with owner admin. Website hispaads.com already exists. Creating owner admin for navalperaldepinares.net. User admin already exists. Creating website for navalperaldepinares.net with owner admin. Website navalperaldepinares.net already exists. Creating owner admin for hispajob.com. User admin already exists. Creating website for hispajob.com with owner admin. Website hispajob.com already exists. Creating owner admin for trescantos.net. User admin already exists. Creating website for trescantos.net with owner admin. Website trescantos.net already exists. Creating owner admin for recetamix.com. User admin already exists. Creating website for recetamix.com with owner admin. Website recetamix.com already exists. Creating owner admin for homefinancial.uk. User admin already exists. Creating website for homefinancial.uk with owner admin. Website homefinancial.uk already exists. Creating owner admin for schoppen.es. User admin already exists. Creating website for schoppen.es with owner admin. Website schoppen.es already exists. Creating owner admin for erreybe.com. User admin already exists. Creating website for erreybe.com with owner admin. Website erreybe.com already exists. Updating credentials for admin... PHP Fatal error: Uncaught ErrorException: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php:306 Stack trace:

0 [internal function]: {closure}()

1 /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php(306): trim()

2 /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php(257): shellExec()

3 /root/transfer-cyberpanel-server/migrate-scripts/01-migrate-websites.php(157): updateLocalUserDatabase()

4 {main}

thrown in /root/transfer-cyberpanel-server/migrate-scripts/inc/functions.inc.php on line 306

It was started migrating but error?

doonfrs commented 1 week ago

Ok, I think I need to skip the admin user from the password update, I publish an update today for that.

ariyandnath commented 1 week ago

yep. please work on it as soon as possible. i hope you are aware of the situation of all the cyberpanel users. That's why and very thank you.

ariyandnath commented 6 days ago

Hey @doonfrs Have you made the changes? It is urgent and very critical you know, That's why ☺️

doonfrs commented 6 days ago

Hi, Please pull the latest version: 1 - PHP 8.1 check 2- fixing some reported bugs 3 - skip admin user from migration 4 - enhanced the logging

doonfrs commented 6 days ago

if you did chmod +x migrate.sh when you pull again you will see a conflict message, I suggest:

git stash
git stash clear
git pull 
chmod +x migrate.sh