首先进行数据备份,找到nextclou的 /www/html/data/admin/files 对admin用户下的文件进行备份。然后在新电脑下执行以下操作:
sudo su -
vi /etc/apt/sources.list
清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse # 预发布软件源,不建议启用 # deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse # deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
然后执行命令:
sudo apt-get update
Centos
yum install -y wget && wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh && bash install.sh aapanel
Ubuntu/Deepin
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && sudo bash install.sh aapanel
Debian
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh && bash install.sh aapanel
在先前更新了国内的镜像地址后,直接安装即可,安装最新版本的 Docker Engine-Community 和 containerd
sudo apt-get install docker-ce docker-ce-cli containerd.io
vi /etc/sysconfig/network-scripts/ifcfg-eth33
修改完成后重启网络服务
service network restart
查看镜像
docker images
将镜像导出
docker save -o mysql.tar mysql
导入镜像
docker load -i mysql.tar
sudo apt-get install openssh-server
docker stop nextcloud && docker rm nextcloud
docker pull nextcloud
docker run -d --restart=always --name nextcloud -p 8180:80 nextcloud:latest
获取nextcloud的id,例如:9a557d7541d5
docker ps
进入Nextcloud容器的Shell环境,且只能用 ls 来查看目录层级,不能使用ll
docker exec -u 0 -it 9a557d7541d5 /bin/bash
拷贝文件
使用以下命令将文件复制到Nextcloud容器中:
Copy Codedocker cp <local_file_path> <container_name_or_id>:<path_in_container>
例如,如果要将本地的 /home/user/data.txt 文件复制到名为nextcloud的容器的 /var/www/html 目录下,可以执行以下命令:
docker cp /home/user/data.txt nextcloud:/var/www/html/
执行扫描文件并刷新
su www-data -s /bin/bash -c 'php occ files:scan --all'
此时再登录nextcloud就可以看到在命令行复制过去的文件了