02 - Upgrading CyberPanel

Thanks very much. No need for you guys to fix it for me! Also, if we can post the solution here, it will help others in the future.

Looks like everything is untracked… perhaps it happened when I was trying to develop the restic incremental backup stuff.

Is it safe to remove it all and upgrade again? Or run the CyberPanel Install script? Or uninstall CyberPanel and Reinstall? Something else?

Well yes if you are doing dev on this server this could have caused the issue, you need to remove the untracked files for upgrade to work.

As you instructed, I removed the entire /usr/local/CyberCP folder, since every file/folder in that directory was untracked. But I got this error when I upgraded

Traceback (most recent call last):
  File "upgrade.py", line 15, in <module>
    from CyberCP import settings
ModuleNotFoundError: No module named 'CyberCP'
above command failed...
root@vps:/usr/local#

What do you recommend I do now?

Not everything, honestly I don’t know why even the CyberCP folder shows untracked in your case. Because there is CyberCP/settings.py file which contained db logins for CyberPanel.

This can be fixed, but since you are using this server for dev I can not comment on what changed.

For SSL issue please create separate thread.

2 Likes

Thanks. I haven’t used the server for dev work for a while now - it was just using 2.1.2. But I probably messed something up with the git config files.

Anyway, my VPS provider’s system messed up somehow and the server snapshot that I took before deleting /usr/local/CyberCP is not working. So now the CP upgrade script doesn’t work at all.

What are my options for getting CyberPanel reinstalled on this server? Can I run the install script? Do I need to start with a fresh Ubuntu install? Could I install CP on another server and copy that folder to this one? Ideally I’ll be able to recover this in some way that maintains the CP database entries, users, created websites, config etc…

Ok, I think I’ve somewhat solved this now.

I deployed a new VPS with CP v2.3.1 and then made a tar.gz of the /usr/local/CyberCP folder and sent it to my other server with rclone sftp and extracted it.

At first, it didn’t work, but then I went into /usr/local/CyberCP/CyberCP/settings.py and updated the database password with what is found from cat /etc/cyberpanel/mysqlPassword and it loaded again.

I was missing some folders from the original install, namely these.

  • .vscode
  • configservercsf
  • CyberPanelDev.code-workspace
  • debug
  • static
  • tmp

Obviously the vscode ones and tmp are irrelevant. I restored configservercsf by uninstalling and reinstalling CSF. Looks like debug isn’t important.

What is /usr/local/CyberCP/static?

Are there any other CyberPanel config files that would be important to check? Database details, system users, etc…?

Hi! I am running two servers with Cyberpanel. One with Ubuntu which has been upgraded fine and another with Centos 7.9 and although shows as upgraded but I see this error under https://myserver:8090/base/versionManagment:

Note: Latest commit does not match, please upgrade.

Current Commit : Unknown option: -C usage: git [–version] [–help] [-c name=value] [–exec-path[=]] [–html-path] [–man-path] [–info-path] [-p|–paginate|–no-pager] [–no-replace-objects] [–bare] [–git-dir=] [–work-tree=] [–namespace=] []

Although it shows 2.3.1 version

/usr/local/CyberCP/static contains static assets of CyberPanel like css and JavaScript files.

You are good to go.

1 Like

It seems on your Centos 7.9 you have old versions of git, can you upgrade the git versions of your server.

I have Git version 1.8.3.1. How can I upgrade it?

I want to say WELL DONE to the Cyberpanel team for the latest release 2.3.1

I run the upgrade a few times (CentOS) with no issues so far, but I was holding my fingers crossed :wink:

Just a few observations that might be helpful to others:

  1. The Cyberpanel upgrade will try to update also your OS somehow… so my advice is to spilt the task into two, especially to help out identifying if the problem is with the OS or Cyberpanel:
    A >> Run first a yum update -y to isolate the OS upgrades and make sure all is working prior the actual Cyberpanel upgrade, and make any necessary adjustments (for example I had to manually recompile some custom PHP extensions because also PHP may get updated)
    B >> Run the Cyberpanel upgrade as indicated at the beginning of this post.

  2. You may want to consider stopping any cron job or the lsws service if you have much activity going on… during the upgrade not everythign works in syntony, and at my first upgrade my server collapsed. I had to roll back the VM snapshot, then I stopped lsws just before upgrading and all went well. The upgrade will start lsws automatically once finished :slight_smile:

  3. @usmannasir I noticed that the upgrade resets the Rainloop Admin password to a random one. Perhaps this should be mentioned in the release notes. The new random password can be found in vi /usr/local/CyberCP/public/rainloop.php Then you can login in Rainloop as Admin and change it back to whatever you want.

Thanks for maintaining the panel secure and updated!!!

1 Like

I just ran into difficulties upgrading with a sudo user (I disabled Root Login recently to have better security). But I think this command solved the problem.

sudo su - -c "sh <(curl https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)"

@die2mrw007 @usmannasir @shoaibkk Can you confirm that this is ok to do? If so, I’ll add it to the official document.

The solution provided by @nick.chomey worked better for me, but I’m still having issues upgrading.

I’m not sure if this is supposed to happen or not, but I’ve had these next issues for a LONG time.

first issue: the litespeed.repo ALWAYS reverts back to this problematic failovermethod=priority

Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/litespeed.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/litespeed.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/litespeed.repo; Configuration: OptionBinding with id "failovermethod" does not exist
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/litespeed.repo; Configuration: OptionBinding with id "failovermethod" does not exist
cloudlinux-x86_64-server-8                                                                                                                                                        35 MB/s |  16 MB     00:00    
CentOS Linux 8 - PowerTools                                                                                                                                                       17 kB/s | 8.1 kB     00:00    
Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 67.219.144.58)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

second issue: CentOS-PowerTools-CyberPanel.repo is always regenerated and continuously gives me errors

Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 74.120.220.234)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
This system is receiving updates from CloudLinux Network server.
CentOS Linux 8 - PowerTools                                                                                                                                                      8.0 kB/s | 8.1 kB     00:01    
Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 208.76.253.18)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
This system is receiving updates from CloudLinux Network server.
CentOS Linux 8 - PowerTools                                                                                                                                                       19 kB/s | 8.1 kB     00:00    
Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 67.219.144.58)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
This system is receiving updates from CloudLinux Network server.
CentOS Linux 8 - PowerTools                                                                                                                                                       12 kB/s | 8.1 kB     00:00    
Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 198.15.72.18)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
This system is receiving updates from CloudLinux Network server.
CentOS Linux 8 - PowerTools                                                                                                                                                       15 kB/s | 8.1 kB     00:00    
Errors during downloading metadata for repository 'powertools-for-cyberpanel':
  - Status code: 404 for http://mirror.centos.org/$contentdir/8/PowerTools/x86_64/os/repodata/repomd.xml (IP: 74.120.220.234)
Error: Failed to download metadata for repo 'powertools-for-cyberpanel': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried 

so, in the end, no matter what I’ve tried, I’m still seeing the same results in the CyberPanel GUI interface.

while most of the install lines seem to be referencing success, these git checkout lines always fail on me.

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git config --global user.email "support@cyberpanel.net" successful.
[05.18.2022_08-37-13] #########################################################################

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git config --global user.name "CyberPanel" successful.
[05.18.2022_08-37-13] #########################################################################

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git fetch successful.
[05.18.2022_08-37-13] #########################################################################
Saved working directory and index state WIP on v2.1.1: 8c0ce5ea Merge pull request #638 from joer80/v2.1.1

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git stash successful.
[05.18.2022_08-37-13] #########################################################################
error: The following untracked working tree files would be overwritten by checkout:
	install/filesPermsUtilities.py
	plogical/filesPermsUtilities.py
Please move or remove them before you switch branches.
Aborting

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git checkout v2.3.1 failed, trying again, try number: 1
[05.18.2022_08-37-13] #########################################################################
error: The following untracked working tree files would be overwritten by checkout:
	install/filesPermsUtilities.py
	plogical/filesPermsUtilities.py
Please move or remove them before you switch branches.
Aborting

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git checkout v2.3.1 failed, trying again, try number: 2
[05.18.2022_08-37-13] #########################################################################
error: The following untracked working tree files would be overwritten by checkout:
	install/filesPermsUtilities.py
	plogical/filesPermsUtilities.py
Please move or remove them before you switch branches.
Aborting

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git checkout v2.3.1 failed, trying again, try number: 3
[05.18.2022_08-37-13] #########################################################################

[05.18.2022_08-37-13] #########################################################################
[05.18.2022_08-37-13] git checkout v2.3.1 failed.
[05.18.2022_08-37-13] #########################################################################

What am I doing wrong and how can I fix this, properly updating my CyberPanel install?

I’ve (albeit incorrectly) fixed the first two issues with these next steps… but, still unable to update.

updated file content failovermethod=priority with #failovermethod=priority
chattr +i /etc/yum.repos.d/CentOS-PowerTools-CyberPanel.repo

emptied file contents and…
chattr +i /etc/yum.repos.d/litespeed.repo

I dont think there is any negative side to this command appending the sudo privileges. But have a confirmation from @usmannasir regarding this.