mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
Auto-commit on 2024-10-25 01:44:26 by pcx3
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# cPanel 2 OpenPanel user import
|
||||
# cPanel 2 OpenPanel account import
|
||||
Free OpenPanel module to import cPanel backup in OpenPanel
|
||||
|
||||
Maintained by [CodeWithJuber](https://github.com/CodeWithJuber)
|
||||
@@ -6,43 +6,37 @@ Maintained by [CodeWithJuber](https://github.com/CodeWithJuber)
|
||||
## Features
|
||||
|
||||
Currently suported for import:
|
||||
```
|
||||
├─ DOMAINS:
|
||||
│ ├─ Primary domain, Addons, Aliases and Subdomains
|
||||
│ ├─ SSL certificates
|
||||
│ ├─ Domains access logs (Apache domlogs)
|
||||
│ └─ DNS zones
|
||||
├─ WEBSITES:
|
||||
│ └─ WordPress instalations from WPToolkit & Softaculous
|
||||
├─ DATABASES:
|
||||
│ ├─ Remote access to MySQL
|
||||
│ └─ MySQL databases, users and grants
|
||||
├─ PHP:
|
||||
│ └─ Installed version from Cloudlinux PHP Selector
|
||||
├─ FILES
|
||||
├─ CRONS
|
||||
├─ SSH
|
||||
│ ├─ Remote SSH access
|
||||
│ ├─ SSH password
|
||||
│ └─ SSH keys
|
||||
└─ ACCOUNT
|
||||
├─ Notification preferences
|
||||
├─ cPanel account creation date
|
||||
└─ locale
|
||||
|
||||
- files and folders
|
||||
- mysql databases, users and grants
|
||||
- domains
|
||||
- dns zones
|
||||
- php version
|
||||
- wp sites
|
||||
- cronjobs
|
||||
|
||||
todo:
|
||||
|
||||
- ftp accounts
|
||||
- email accounts
|
||||
- nodejs/python apps
|
||||
- postgresql
|
||||
- ssh keys
|
||||
- ssl certificates
|
||||
|
||||
Steps:
|
||||
|
||||
|
||||
# cPanel to OpenPanel Migration Script
|
||||
|
||||
This script automates the process of migrating a cPanel backup to OpenPanel server. It handles various cPanel backup formats and restores essential components of the user's account.
|
||||
|
||||
## Features
|
||||
|
||||
- Supports multiple cPanel backup formats (cpmove, full backup, tar.gz, tgz, tar, zip)
|
||||
- Restores user account details, domains, and hosting plan settings
|
||||
- Migrates websites, databases, domains, SSL certificates, and DNS zones
|
||||
- Handles PHP version settings and cron jobs
|
||||
- Restores SSH access and file permissions
|
||||
***emails, ftp, nodejs/python, postgres are not yet supported***
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
1. Run the script with sudo privileges:
|
||||
Run the script with sudo privileges:
|
||||
|
||||
```
|
||||
git clone https://github.com/stefanpejcic/cPanel-to-OpenPanel
|
||||
@@ -55,7 +49,8 @@ bash cPanel-to-OpenPanel/cp-import.sh --backup-location /path/to/cpanel_backup.f
|
||||
## Parameters
|
||||
|
||||
- `--backup-location`: Path to the cPanel backup file (required)
|
||||
- `--plan-name`: Name of the hosting plan in OpenPanel (required)
|
||||
- `--plan-name`: Name of the hosting plan in OpenPanel (required)
|
||||
- `--dry-run`: extract archive and display data without actually importing account (optional)
|
||||
|
||||
## Important Notes
|
||||
|
||||
|
||||
1074
integrations/cpanel-import/cp-import-my-version.sh
Normal file
1074
integrations/cpanel-import/cp-import-my-version.sh
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,35 +0,0 @@
|
||||
import os
|
||||
import json # will use for get to return data
|
||||
import socket
|
||||
from flask import Flask, Response, abort, render_template, request, send_file, g, jsonify, session, url_for, flash, redirect, get_flashed_messages
|
||||
import subprocess
|
||||
from app import app, is_license_valid, login_required_route
|
||||
from modules.helpers import get_all_plans, is_username_unique
|
||||
|
||||
@app.route('/import/cpanel', methods=['GET', 'POST'])
|
||||
@login_required
|
||||
def import_cpanel_whm_account():
|
||||
if request.method == 'POST':
|
||||
path = request.form.get('path')
|
||||
plan_name = request.form.get('plan_name')
|
||||
|
||||
if not path or not plan_name:
|
||||
flash('Both path to the cPanel backup file (.tar.gz) and plan name are required!', 'error')
|
||||
return redirect('/import/cpanel')
|
||||
try:
|
||||
file_name = os.path.basename(path)
|
||||
log_file_name = f"cpanel_import_log_{os.path.splitext(file_name)[0]}"
|
||||
log_file_path = f"/var/log/openpanel/admin/{log_file_name}.log"
|
||||
|
||||
# Run the subprocess command and redirect stdout and stderr to the log file
|
||||
with open(log_file_path, 'w') as log_file:
|
||||
subprocess.Popen(['opencli', 'user-import', 'cpanel', path, plan_name], stdout=log_file, stderr=log_file)
|
||||
|
||||
flash(f'Import started! To track the progress open the log file: {log_file_path}', 'success')
|
||||
except Exception as e:
|
||||
flash(f'An error occurred: {str(e)}', 'error')
|
||||
|
||||
return redirect('/import/cpanel')
|
||||
else:
|
||||
# on GET we will list the sessions in progress..
|
||||
return render_template('cpanel-import.html', title='Import cPanel account')
|
||||
@@ -1,19 +0,0 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
{% for message in messages %}
|
||||
<div class="alert alert-warning alert-dismissible" role="alert">
|
||||
{{ message }}
|
||||
<a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
1
integrations/digitalocean/.github/CODEOWNERS
vendored
1
integrations/digitalocean/.github/CODEOWNERS
vendored
@@ -1 +0,0 @@
|
||||
@marketplace-eng
|
||||
@@ -1,27 +0,0 @@
|
||||
# Contributing
|
||||
|
||||
We enthusiastically encourage contributions of all sorts to our repository, from correcting typos, to improving checks or adding new ones.
|
||||
|
||||
### Reporting Issues
|
||||
|
||||
This section guides you through submitting an issue for the Marketplace Partners. Following these guidelines helps maintainers and the community understand your report :pencil:, reproduce the behavior :computer: :computer:, and find related reports :mag_right:.
|
||||
|
||||
When you are reporting an issue, please [include as many details as possible](#how-do-i-submit-a-good-bug-report).
|
||||
|
||||
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
|
||||
|
||||
#### Before Submitting An Issue
|
||||
* **Check the [current issues](https://github.com/digitalocean/marketplace-partners/issues)**.
|
||||
|
||||
#### How Do I Submit A (Good) Issue?
|
||||
|
||||
Issues are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information listed below.
|
||||
|
||||
Explain the problem and include additional details to help maintainers reproduce the problem:
|
||||
|
||||
* **Use a clear and descriptive title** for the issue to identify the problem.
|
||||
* **Describe the exact steps which reproduce the problem** in as many details as possible. When listing steps, **don't just say what you did, but explain how you did it**.
|
||||
* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pasteable snippets, which you use in those examples. If you're providing snippets in the issue, use [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
|
||||
* **Describe the behavior you observed after following the steps** and point out what exactly is the problem with that behavior.
|
||||
* **Explain which behavior you expected to see instead and why.**
|
||||
* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem.
|
||||
43
integrations/digitalocean/.gitignore
vendored
43
integrations/digitalocean/.gitignore
vendored
@@ -1,43 +0,0 @@
|
||||
# Compiled source #
|
||||
###################
|
||||
*.com
|
||||
*.class
|
||||
*.dll
|
||||
*.exe
|
||||
*.o
|
||||
*.so
|
||||
|
||||
# Packages #
|
||||
############
|
||||
# it's better to unpack these files and commit the raw source
|
||||
# git has its own built in compression methods
|
||||
*.7z
|
||||
*.dmg
|
||||
*.gz
|
||||
*.iso
|
||||
*.jar
|
||||
*.rar
|
||||
*.tar
|
||||
*.zip
|
||||
|
||||
# Logs and databases #
|
||||
######################
|
||||
*.log
|
||||
*.sql
|
||||
*.sqlite
|
||||
|
||||
# OS generated files #
|
||||
######################
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
|
||||
# App generated files #
|
||||
######################
|
||||
.vscode
|
||||
|
||||
.Rproj.user
|
||||
Reference in New Issue
Block a user