Error in restoring backup (Omnibus)

Hello, I have taken a backup from Firezone according to the site guide
I uploaded it to the new server and unzipped it
I have put the files in their places, but I am facing an error
I will send you the instructions below

Server A (Backup):

$ firezone-ctl stop
$ tar cvzf firezone.tar.gz /var/opt/firezone /opt/firezone /usr/bin/firezone-ctl /etc/systemd/system/firezone-runsvdir-start.service /etc/firezone
$ firezone-ctl start
$ rsync -avz --progress /root/firezone.tar.gz root@Server B:/root/firezone.tar.gz

Server B (Restore):

$ tar -xvf firezone.tar.gz 
$ rsync -a /root/etc/ /etc/
$ rsync -a /root/opt/ /opt/
$ rsync -a /root/var/ /var/
$ rsync -a /root/usr/ /usr/
firezone-ctl reconfigure

I get an error in the following sections:

root@Pwz1:~# firezone-ctl reconfigure
Chef Infra Client, version 17.10.68
Patents: https://www.chef.io/patents
Infra Phase starting
Resolving cookbooks for run list: ["firezone::default"]
Synchronizing cookbooks:
  - firezone (0.0.1)
  - enterprise (1.2.0)
  - runit (5.1.7)
  - line (4.5.12)
  - packagecloud (2.0.2)
  - yum-epel (5.0.0)
Installing cookbook gem dependencies:
Compiling cookbooks...
Loading Chef InSpec profile files:
Loading Chef InSpec input files:
Loading Chef InSpec waiver files:
Converging 63 resources
Recipe: firezone::config
  * linux_user[firezone] action create (up to date)
  * group[firezone] action create (up to date)
  * directory[/etc/firezone] action create (up to date)
  * directory[/var/opt/firezone] action create (up to date)
  * directory[/opt/firezone/embedded/service/firezone/tmp] action create (up to date)
  * directory[/var/log/firezone] action create (up to date)
  * directory[/var/opt/firezone/etc] action create (up to date)
  * file[configuration-variables] action create (up to date)
  * file[/etc/firezone/secrets.json] action create (up to date)
  * file[/var/opt/firezone/cache/wg_private_key] action create (up to date)
Recipe: firezone::log_management
  * directory[/var/opt/firezone/etc/logrotate.d] action create (up to date)
  * template[/var/opt/firezone/etc/logrotate.conf] action create (up to date)
  * template[/etc/cron.hourly/firezone_logrotate] action create (up to date)
Recipe: firezone::ssl
  * directory[/var/opt/firezone/ssl] action create (up to date)
  * directory[/var/opt/firezone/ssl/ca] action create (up to date)
  * openssl_dhparam[/var/opt/firezone/ssl/ca/dhparams.pem] action create
    * file[/var/opt/firezone/ssl/ca/dhparams.pem] action create (up to date)
     (up to date)
  * openssl_x509_certificate[/var/opt/firezone/ssl/ca/188.132.129.71.crt] action create
    * file[/var/opt/firezone/ssl/ca/x.x.x.x.crt] action create_if_missing (up to date)
    * file[/var/opt/firezone/ssl/ca/x.x.x.x.key] action create_if_missing (up to date)
     (up to date)
  * link[/var/opt/firezone/ssl/cacert.pem] action create (up to date)
  * openssl_x509_certificate[/var/opt/firezone/ssl/saml.crt] action create
    * file[/var/opt/firezone/ssl/saml.crt] action create_if_missing (up to date)
    * file[/var/opt/firezone/ssl/saml.key] action create_if_missing (up to date)
     (up to date)
Recipe: firezone::network
  * replace_or_add[IPv4 packet forwarding] action edit
    * file[/etc/sysctl.conf] action create (up to date)
     (up to date)
  * replace_or_add[IPv6 packet forwarding] action edit
    * file[/etc/sysctl.conf] action create (up to date)
     (up to date)
  * execute[sysctl -p /etc/sysctl.conf] action run
    - execute sysctl -p /etc/sysctl.conf
Recipe: enterprise::runit
  * component_runit_supervisor[firezone] action create
    * template[/etc/systemd/system/firezone-runsvdir-start.service] action create (up to date)
    * execute[systemctl daemon-reload] action nothing (skipped due to action :nothing)
    * file[/usr/lib/systemd/system/firezone-runsvdir-start.service] action delete (up to date)
    * service[firezone-runsvdir-start.service] action enable (up to date)
    * service[firezone-runsvdir-start.service] action start (up to date)
     (up to date)
Recipe: firezone::postgresql
  * sysctl[kernel.shmmax] action apply (up to date)
  * sysctl[kernel.shmall] action apply (up to date)
  * directory[/var/log/firezone/postgresql] action create (up to date)
  * enterprise_pg_cluster[firezone] action init
    * directory[/var/opt/firezone/postgresql/13.3/data] action create (up to date)
    * execute[initialize_cluster_/var/opt/firezone/postgresql/13.3/data] action run (skipped due to not_if)
    * template[/var/opt/firezone/postgresql/13.3/data/postgresql.conf] action create (up to date)
    * template[/var/opt/firezone/postgresql/13.3/data/pg_hba.conf] action create (up to date)
     (up to date)
  * component_runit_service[postgresql] action enable
    * template[/var/log/firezone/postgresql/config] action create (up to date)
    * service[postgresql] action nothing (skipped due to action :nothing)
    * runit_service[postgresql] action enable
      * ruby_block[restart_service] action nothing (skipped due to action :nothing)
      * ruby_block[restart_log_service] action nothing (skipped due to action :nothing)
      * directory[/opt/firezone/sv/postgresql] action create (up to date)
      * template[/opt/firezone/sv/postgresql/run] action create (up to date)
      * directory[/opt/firezone/sv/postgresql/log] action create (up to date)
      * directory[/opt/firezone/sv/postgresql/log/main] action create (up to date)
      * directory[/var/log/postgresql] action create (up to date)
      * template[/opt/firezone/sv/postgresql/log/config] action create (up to date)
      * link[/var/log/postgresql/config] action create (up to date)
      * template[/opt/firezone/sv/postgresql/log/run] action create (up to date)
      * directory[/opt/firezone/sv/postgresql/env] action create (up to date)
      * ruby_block[Delete unmanaged env files for postgresql service] action run (skipped due to only_if)
      * template[/opt/firezone/sv/postgresql/check] action create (skipped due to only_if)
      * template[/opt/firezone/sv/postgresql/finish] action create (skipped due to only_if)
      * directory[/opt/firezone/sv/postgresql/control] action create (up to date)
      * template[/opt/firezone/sv/postgresql/control/t] action create (up to date)
      * link[/opt/firezone/init/postgresql] action create (up to date)
      * file[/opt/firezone/sv/postgresql/down] action nothing (skipped due to action :nothing)
      * directory[/opt/firezone/service] action create (up to date)
      * link[/opt/firezone/service/postgresql] action create (up to date)
      * ruby_block[wait for postgresql service socket] action run
        - execute the ruby block wait for postgresql service socket
    
  
Recipe: firezone::nginx
  * directory[/var/opt/firezone/nginx/cache] action create (up to date)
  * directory[/var/log/firezone/nginx] action create (up to date)
  * directory[/var/opt/firezone/nginx/etc] action create (up to date)
  * directory[/var/opt/firezone/nginx/etc/conf.d] action create (up to date)
  * directory[/var/opt/firezone/nginx/etc/sites-enabled] action create (up to date)
  * directory[/var/opt/firezone/nginx/acme_root] action create (up to date)
  * directory[/var/opt/firezone/nginx/acme_root/.well-known] action create (up to date)
  * directory[/var/opt/firezone/nginx/acme_root/.well-known/acme-challenge] action create (up to date)
  * link[/var/opt/firezone/nginx/etc/mime.types] action create (up to date)
  * template[nginx.conf] action create (up to date)
  * template[redirect.conf] action create (up to date)
  * component_runit_service[nginx] action enable
    * template[/var/log/firezone/nginx/config] action create (up to date)
    * service[nginx] action nothing (skipped due to action :nothing)
    * runit_service[nginx] action enable
      * ruby_block[restart_service] action nothing (skipped due to action :nothing)
      * ruby_block[restart_log_service] action nothing (skipped due to action :nothing)
      * directory[/opt/firezone/sv/nginx] action create (up to date)
      * template[/opt/firezone/sv/nginx/run] action create (up to date)
      * directory[/opt/firezone/sv/nginx/log] action create (up to date)
      * directory[/opt/firezone/sv/nginx/log/main] action create (up to date)
      * directory[/var/log/nginx] action create (up to date)
      * template[/opt/firezone/sv/nginx/log/config] action create (up to date)
      * link[/var/log/nginx/config] action create (up to date)
      * template[/opt/firezone/sv/nginx/log/run] action create (up to date)
      * directory[/opt/firezone/sv/nginx/env] action create (up to date)
      * ruby_block[Delete unmanaged env files for nginx service] action run (skipped due to only_if)
      * template[/opt/firezone/sv/nginx/check] action create (skipped due to only_if)
      * template[/opt/firezone/sv/nginx/finish] action create (skipped due to only_if)
      * directory[/opt/firezone/sv/nginx/control] action create (up to date)
      * link[/opt/firezone/init/nginx] action create (up to date)
      * file[/opt/firezone/sv/nginx/down] action nothing (skipped due to action :nothing)
      * directory[/opt/firezone/service] action create (up to date)
      * link[/opt/firezone/service/nginx] action create (up to date)
      * ruby_block[wait for nginx service socket] action run
        - execute the ruby block wait for nginx service socket
    
  
  * template[/var/opt/firezone/etc/logrotate.d/nginx] action create (up to date)
Recipe: firezone::acme
  * file[/opt/firezone/embedded/bin/acme.sh] action create (up to date)
  * execute[ACME remove cronjob] action run
    - execute /opt/firezone/embedded/bin/acme.sh --uninstall-cronjob
  
Recipe: firezone::database
  * enterprise_pg_user[firezone] action create (skipped due to not_if)
  * enterprise_pg_database[firezone] action create
    * execute[create_database_firezone] action run
      
      ================================================================================
      Error executing action `run` on resource 'execute[create_database_firezone]'
      ================================================================================
      
      Mixlib::ShellOut::ShellCommandFailed
      ------------------------------------
      Expected process to exit with [0], but received '1'
      ---- Begin output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
      STDOUT: 
      STDERR: createdb: error: could not connect to database template1: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 15432?
      ---- End output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
      Ran createdb --template template0 --encoding UTF-8 --owner firezone firezone returned 1
      
      Cookbook Trace: (most recent call first)
      ----------------------------------------
      /var/opt/firezone/cache/cache/cookbooks/enterprise/resources/pg_database.rb:41:in `block in class_from_file'
      
      Resource Declaration:
      ---------------------
      # In /var/opt/firezone/cache/cache/cookbooks/enterprise/resources/pg_database.rb
      
       41:   execute "create_database_#{new_resource.database}" do
       42:     command createdb_command
       43:     user node[project_name]['postgresql']['username']
       44:     not_if { database_exist? }
       45:     retries 30
       46:   end
       47: end
      
      Compiled Resource:
      ------------------
      # Declared in /var/opt/firezone/cache/cache/cookbooks/enterprise/resources/pg_database.rb:41:in `block in class_from_file'
      
      execute("create_database_firezone") do
        action [:run]
        default_guard_interpreter :execute
        command "createdb --template template0 --encoding UTF-8 --owner firezone firezone"
        declared_type :execute
        cookbook_name "firezone"
        recipe_name "database"
        domain nil
        user "firezone"
        retries 30
        not_if { #code block }
      end
      
      System Info:
      ------------
      chef_version=17.10.68
      platform=ubuntu
      platform_version=22.04
      ruby=ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]
      program_name=/opt/firezone/embedded/bin/chef-client
      executable=/opt/firezone/embedded/bin/chef-client
      
    
    ================================================================================
    Error executing action `create` on resource 'enterprise_pg_database[firezone]'
    ================================================================================
    
    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    execute[create_database_firezone] (firezone::database line 41) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
    ---- Begin output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
    STDOUT: 
    STDERR: createdb: error: could not connect to database template1: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 15432?
    ---- End output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
    Ran createdb --template template0 --encoding UTF-8 --owner firezone firezone returned 1
    
    Cookbook Trace: (most recent call first)
    ----------------------------------------
    /var/opt/firezone/cache/cache/cookbooks/enterprise/resources/pg_database.rb:41:in `block in class_from_file'
    
    Resource Declaration:
    ---------------------
    # In /var/opt/firezone/cache/cache/cookbooks/firezone/recipes/database.rb
    
     47:   enterprise_pg_database node['firezone']['database']['name'] do
     48:     owner node['firezone']['database']['user']
     49:   end
     50: end
    
    Compiled Resource:
    ------------------
    # Declared in /var/opt/firezone/cache/cache/cookbooks/firezone/recipes/database.rb:47:in `from_file'
    
    enterprise_pg_database("firezone") do
      action [:create]
      default_guard_interpreter :default
      declared_type :enterprise_pg_database
      cookbook_name "firezone"
      recipe_name "database"
      owner "firezone"
      template "template0"
      encoding "UTF-8"
    end
    
    System Info:
    ------------
    chef_version=17.10.68
    platform=ubuntu
    platform_version=22.04
    ruby=ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [x86_64-linux]
    program_name=/opt/firezone/embedded/bin/chef-client
    executable=/opt/firezone/embedded/bin/chef-client
    

Running handlers:
[2023-11-05T01:08:50+01:00] ERROR: Running exception handlers
Running handlers complete
[2023-11-05T01:08:50+01:00] ERROR: Exception handlers complete
Infra Phase failed. 8 resources updated in 01 minutes 11 seconds
[2023-11-05T01:08:50+01:00] FATAL: Stacktrace dumped to /var/opt/firezone/cache/cache/chef-stacktrace.out
[2023-11-05T01:08:50+01:00] FATAL: ---------------------------------------------------------------------------------------
[2023-11-05T01:08:50+01:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2023-11-05T01:08:50+01:00] FATAL: ---------------------------------------------------------------------------------------
[2023-11-05T01:08:50+01:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: enterprise_pg_database[firezone] (firezone::database line 47) had an error: Mixlib::ShellOut::ShellCommandFailed: execute[create_database_firezone] (firezone::database line 41) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
STDOUT: 
STDERR: createdb: error: could not connect to database template1: could not connect to server: Connection refused
        Is the server running on host "127.0.0.1" and accepting
        TCP/IP connections on port 15432?
---- End output of createdb --template template0 --encoding UTF-8 --owner firezone firezone ----
Ran createdb --template template0 --encoding UTF-8 --owner firezone firezone returned 1

Please help me :pray: :pray: