nextcloud downgrade 私有云版本回退

今天更新nextcloud的时候提示新版本不支持php7.4,nextcloud无法正常运行了

在官网的社区并没有看到downgrade的教程 这里简单看了以下nextcloud目录下的backup,成功恢复到了以前的版本,记录一下

首先 假设nextcloud是安装在/var/www/nextcloud目录下,数据存储在/var/www/data下

那么data下有一个updater加上参数的文件夹,进入之后cd backups文件夹 之后就能看到之前版本的备份。

将备份移动到之前的nextcloud目录下,并且记得给予data文件夹权限

chown -R www-data:www-data /var/www/nextcloud/

重新访问域名 发现万事大吉

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是 CentOS 8 一键安装 Nextcloud 和 OnlyOffice 的脚本: ```bash #!/bin/bash # 安装 Nextcloud 和 OnlyOffice # 本脚本仅适用于 CentOS 8 # 安装依赖 dnf install -y epel-release dnf install -y wget unzip nginx mariadb-server php php-fpm php-mysqlnd php-gd php-mbstring php-zip php-intl php-opcache php-xml php-json redis php-pecl-redis # 下载 Nextcloud wget https://download.nextcloud.com/server/releases/latest.zip -O /tmp/nextcloud.zip # 解压 Nextcloud unzip /tmp/nextcloud.zip -d /usr/share/nginx/html/ # 设置权限 chown -R nginx:nginx /usr/share/nginx/html/nextcloud/ # 配置 Nginx cat << EOF > /etc/nginx/conf.d/nextcloud.conf server { listen 80; server_name your.domain.com; add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; fastcgi_hide_header X-Powered-By; root /usr/share/nginx/html/nextcloud; location / { rewrite ^ /index.php$request_uri; } location ~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/ { deny all; } location ~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { deny all; } location ~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\.php(?:$|/) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info; try_files $fastcgi_script_name =404; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $path_info; fastcgi_param HTTPS on; fastcgi_param modHeadersAvailable true; fastcgi_param front_controller_active true; fastcgi_pass unix:/run/php-fpm/www.sock; fastcgi_intercept_errors on; fastcgi_request_buffering off; fastcgi_read_timeout 300; } location ~ ^/(?:updater|ocs-provider)(?:$|/) { try_files $uri/ =404; index index.php; } location ~ \.(?:css|js|woff2?|svg|gif|png|html|ttf|ico|jpg|jpeg)$ { try_files $uri /index.php$request_uri; access_log off; expires 360d; add_header Cache-Control "public, max-age=31536000, immutable"; add_header Pragma public; add_header ETag ""; } location ~ \.(?:manifest|appcache|html|xml|json)$ { add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0"; add_header Pragma no-cache; } location ~ /\. { deny all; access_log off; log_not_found off; } } EOF # 重启 Nginx systemctl restart nginx # 配置 MariaDB systemctl enable mariadb systemctl start mariadb mysql -u root << END CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'password'; CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost'; FLUSH PRIVILEGES; END # 下载 OnlyOffice wget https://github.com/ONLYOFFICE/DocumentServer/releases/download/v6.4.2/ONLYOFFICE-documentserver-opensource-src.v6.4.2.tar.gz -O /tmp/onlyoffice.tar.gz # 解压 OnlyOffice tar -zxvf /tmp/onlyoffice.tar.gz -C /usr/share/nginx/html/ # 设置权限 chown -R nginx:nginx /usr/share/nginx/html/documentserver/ # 配置 Nginx cat << EOF > /etc/nginx/conf.d/onlyoffice.conf server { listen 80; server_name document.domain.com; add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;"; add_header X-Content-Type-Options nosniff; add_header X-XSS-Protection "1; mode=block"; add_header X-Robots-Tag none; add_header X-Download-Options noopen; add_header X-Permitted-Cross-Domain-Policies none; add_header Referrer-Policy no-referrer-when-downgrade; add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'"; client_max_body_size 0; location / { proxy_pass https://127.0.0.1:8443; proxy_http_version 1.1; proxy_set_header Upgrade \$http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host \$host; proxy_set_header X-Real-IP \$remote_addr; proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto \$scheme; proxy_set_header X-Forwarded-Host \$host; } } EOF # 生成 SSL 证书 dnf install -y certbot python3-certbot-nginx certbot --nginx -d your.domain.com -d document.domain.com # 重启 Nginx systemctl restart nginx ``` 在脚本中,您需要将以下内容替换为您自己的配置: - `your.domain.com`:您的 Nextcloud 域名 - `document.domain.com`:您的 OnlyOffice 域名 - `password`:您的 Nextcloud 数据库密码 安装完成后,您可以通过 `https://your.domain.com` 访问 Nextcloud,通过 `https://document.domain.com` 访问 OnlyOffice。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值