{"id":116442,"date":"2025-07-02T16:23:59","date_gmt":"2025-07-02T09:23:59","guid":{"rendered":"https:\/\/tino.vn\/blog\/?p=116442"},"modified":"2026-10-23T18:54:17","modified_gmt":"2026-10-23T11:54:17","slug":"cach-backup-va-restore-workflow-n8n","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/cach-backup-va-restore-workflow-n8n\/","title":{"rendered":"Backup v\u00e0 restore n8n: workflow, credential v\u00e0 kh\u00f3a m\u00e3 h\u00f3a"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Backup n8n \u0111\u1ea7y \u0111\u1ee7 g\u1ed3m 3 ph\u1ea7n:<\/strong> workflow, credential v\u00e0 kh\u00f3a m\u00e3 h\u00f3a <code>N8N_ENCRYPTION_KEY<\/code> trong th\u01b0 m\u1ee5c .n8n. Tr\u00ean b\u1ea3n t\u1ef1 host, c\u00e1ch g\u1ecdn nh\u1ea5t l\u00e0 ch\u1ea1y <code>n8n export:workflow --backup<\/code> v\u00e0 <code>n8n export:credentials --backup<\/code>, r\u1ed3i ch\u00e9p k\u1ebft qu\u1ea3 c\u00f9ng kh\u00f3a ra ngo\u00e0i m\u00e1y ch\u1ee7. Kh\u00f4ng v\u00e0o \u0111\u01b0\u1ee3c m\u00e1y ch\u1ee7 th\u00ec d\u00f9ng workflow g\u1ecdi n8n API \u0111\u1ec3 \u0111\u1ea9y workflow l\u00ean Google Drive.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">B\u00e0i d\u00e0nh cho <a href=\"https:\/\/tino.vn\/blog\/n8n-la-gi\/\">n8n<\/a> t\u1ef1 host tr\u00ean VPS ho\u1eb7c m\u00e1y t\u00ednh, c\u00f3 c\u1ea3 c\u00e1ch kh\u00f4i ph\u1ee5c. Ch\u01b0a c\u00e0i n8n th\u00ec xem <a href=\"https:\/\/tino.vn\/blog\/cach-cai-dat-n8n-tren-vps\/\">c\u00e1ch c\u00e0i \u0111\u1eb7t n8n tr\u00ean VPS<\/a> tr\u01b0\u1edbc. L\u1ec7nh trong b\u00e0i ki\u1ec3m theo n8n 2.44.6 (b\u1ea3n stable ng\u00e0y 22\/10\/2026).<\/p>\n\n\n\n<h2 id=\"B\u1ea3n_backup_n8n_c\u1ea7n_g\u1ed3m_nh\u1eefng_g\u00ec?\">B\u1ea3n backup n8n c\u1ea7n g\u1ed3m nh\u1eefng g\u00ec?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1ed9t b\u1ea3n backup n8n kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c ph\u1ea3i c\u00f3 th\u01b0 m\u1ee5c .n8n (ch\u1ee9a file c\u1ea5u h\u00ecnh c\u00f3 kh\u00f3a m\u00e3 h\u00f3a v\u00e0, v\u1edbi SQLite, c\u1ea3 database), database PostgreSQL n\u1ebfu b\u1ea1n d\u00f9ng, v\u00e0 c\u1ea5u h\u00ecnh tri\u1ec3n khai nh\u01b0 <code>.env<\/code>, <code>compose.yaml<\/code>. Credential trong database \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a b\u1eb1ng kh\u00f3a \u0111\u00f3, n\u00ean thi\u1ebfu kh\u00f3a th\u00ec b\u1ea3n backup credential kh\u00f4ng d\u00f9ng \u0111\u01b0\u1ee3c (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/keep-n8n-running\/backup-and-restore\" rel=\"nofollow noopener\" target=\"_blank\">Back up and restore<\/a>).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-ban-backup-gom-gi.webp\" alt=\"Ba ph\u1ea7n c\u1ee7a b\u1ea3n backup n8n t\u1ef1 host: th\u01b0 m\u1ee5c .n8n trong volume n8n_data, kh\u00f3a m\u00e3 h\u00f3a trong file config ho\u1eb7c bi\u1ebfn N8N_ENCRYPTION_KEY, PostgreSQL c\u00f9ng .env v\u00e0 compose.yaml; l\u1ec7nh export --backup ch\u1ec9 l\u1ea5y workflow v\u00e0 credential, kh\u00f4ng c\u00f3 user, l\u1ecbch s\u1eed ch\u1ea1y v\u00e0 variables\" class=\"wp-image-131722\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-ban-backup-gom-gi.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-ban-backup-gom-gi-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-ban-backup-gom-gi-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-ban-backup-gom-gi-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Ph\u1ea7n<\/th><th>N\u1eb1m \u1edf \u0111\u00e2u<\/th><th>Sao l\u01b0u b\u1eb1ng<\/th><\/tr><\/thead><tbody><tr><td>Workflow<\/td><td>Database (SQLite trong .n8n ho\u1eb7c PostgreSQL)<\/td><td><code>n8n export:workflow --backup<\/code> ho\u1eb7c workflow g\u1ecdi n8n API<\/td><\/tr><tr><td>Credential<\/td><td>Database, \u0111\u00e3 m\u00e3 h\u00f3a<\/td><td><code>n8n export:credentials --backup<\/code> (gi\u1eef nguy\u00ean m\u00e3 h\u00f3a)<\/td><\/tr><tr><td>Kh\u00f3a m\u00e3 h\u00f3a<\/td><td>File <code>~\/.n8n\/config<\/code> ho\u1eb7c bi\u1ebfn <code>N8N_ENCRYPTION_KEY<\/code><\/td><td>Ch\u00e9p ri\u00eang, c\u1ea5t ngo\u00e0i m\u00e1y ch\u1ee7<\/td><\/tr><tr><td>User, l\u1ecbch s\u1eed ch\u1ea1y, variables, c\u00e0i \u0111\u1eb7t<\/td><td>Database<\/td><td>Ch\u00e9p th\u01b0 m\u1ee5c .n8n (SQLite) ho\u1eb7c <code>pg_dump<\/code> (PostgreSQL)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">B\u1ea3n export CLI kh\u00f4ng g\u1ed3m user, execution v\u00e0 variables (docs.n8n.io, 23\/10\/2026)<\/figcaption><\/figure>\n\n\n\n<h2 id=\"V\u00ec_sao_c\u1ea7n_backup_n8n_\u0111\u1ecbnh_k\u1ef3?\">V\u00ec sao c\u1ea7n backup n8n \u0111\u1ecbnh k\u1ef3?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Backup n8n \u0111\u1ecbnh k\u1ef3 gi\u00fap b\u1ea1n d\u1ef1ng l\u1ea1i workflow v\u00e0 k\u1ebft n\u1ed1i khi m\u00e1y ch\u1ee7 h\u1ecfng \u1ed5 \u0111\u0129a, khi x\u00f3a nh\u1ea7m, khi b\u1ea3n c\u1eadp nh\u1eadt l\u1ed7i ho\u1eb7c khi chuy\u1ec3n sang VPS kh\u00e1c. n8n t\u1ef1 host kh\u00f4ng c\u00f3 th\u00f9ng r\u00e1c cho workflow \u0111\u00e3 x\u00f3a, v\u00e0 ng\u01b0\u1eddi v\u1eadn h\u00e0nh t\u1ef1 ch\u1ecbu tr\u00e1ch nhi\u1ec7m l\u01b0u tr\u1eef d\u1eef li\u1ec7u.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>M\u00e1y ch\u1ee7 h\u1ecfng ho\u1eb7c b\u1ecb x\u00f3a:<\/strong> m\u1ea5t volume l\u00e0 m\u1ea5t c\u1ea3 workflow, credential v\u00e0 l\u1ecbch s\u1eed ch\u1ea1y.<\/li>\n\n\n<li><strong>X\u00f3a nh\u1ea7m ho\u1eb7c ghi \u0111\u00e8:<\/strong> d\u1ec5 x\u1ea3y ra khi nhi\u1ec1u ng\u01b0\u1eddi c\u00f9ng s\u1eeda m\u1ed9t workflow.<\/li>\n\n\n<li><strong>C\u1eadp nh\u1eadt l\u1ed7i:<\/strong> b\u1ea3n m\u1edbi ch\u1ea1y migration database; mu\u1ed1n quay v\u1ec1 b\u1ea3n c\u0169 ph\u1ea3i c\u00f3 b\u1ea3n sao tr\u01b0\u1edbc l\u00fac n\u00e2ng (<a href=\"https:\/\/tino.vn\/blog\/cach-cap-nhat-n8n\/\">c\u00e1ch c\u1eadp nh\u1eadt n8n<\/a>).<\/li>\n\n\n<li><strong>M\u1ea5t credential:<\/strong> workflow v\u1eabn c\u00f2n nh\u01b0ng kh\u00f4ng g\u1ecdi \u0111\u01b0\u1ee3c d\u1ecbch v\u1ee5 n\u00e0o cho \u0111\u1ebfn khi b\u1ea1n nh\u1eadp l\u1ea1i t\u1eebng API key, OAuth. Credential l\u00e0 th\u00f4ng tin x\u00e1c th\u1ef1c (API key, Client ID\/Secret, token) m\u00e0 node d\u00f9ng \u0111\u1ec3 k\u1ebft n\u1ed1i d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i.<\/li>\n\n\n<li><strong>Chuy\u1ec3n m\u00e1y ch\u1ee7:<\/strong> b\u1ea3n backup \u0111\u1ea7y \u0111\u1ee7 l\u00e0 \u0111\u1ea7u v\u00e0o c\u1ee7a vi\u1ec7c <a href=\"https:\/\/tino.vn\/blog\/cach-chuyen-n8n-sang-vps-moi\/\">chuy\u1ec3n n8n sang VPS m\u1edbi<\/a>.<\/li>\n<\/ul>\n\n\n\n<h2 id=\"N\u00ean_ch\u1ecdn_c\u00e1ch_backup_n8n_n\u00e0o?\">N\u00ean ch\u1ecdn c\u00e1ch backup n8n n\u00e0o?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu b\u1ea1n SSH \u0111\u01b0\u1ee3c v\u00e0o m\u00e1y ch\u1ea1y n8n, h\u00e3y d\u00f9ng l\u1ec7nh CLI ch\u1ea1y theo l\u1ecbch: l\u1ec7nh l\u1ea5y \u0111\u01b0\u1ee3c c\u1ea3 workflow l\u1eabn credential m\u00e0 kh\u00f4ng c\u1ea7n b\u1eadt node nguy hi\u1ec3m. N\u1ebfu ch\u1ec9 c\u00f3 giao di\u1ec7n web, v\u00ed d\u1ee5 n8n Cloud g\u00f3i tr\u1ea3 ph\u00ed, d\u00f9ng workflow g\u1ecdi n8n API \u0111\u1ec3 l\u01b0u workflow l\u00ean Google Drive; c\u00e1ch n\u00e0y kh\u00f4ng l\u1ea5y \u0111\u01b0\u1ee3c credential.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1400\" height=\"750\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-chon-cach.webp\" alt=\"Ch\u1ecdn c\u00e1ch backup n8n theo quy\u1ec1n truy c\u1eadp: v\u00e0o \u0111\u01b0\u1ee3c terminal m\u00e1y ch\u1ea1y n8n th\u00ec d\u00f9ng l\u1ec7nh CLI ch\u1ea1y b\u1eb1ng cron, l\u1ea5y c\u1ea3 workflow v\u00e0 credential v\u1eabn m\u00e3 h\u00f3a, k\u00e8m volume v\u00e0 kh\u00f3a; kh\u00f4ng v\u00e0o \u0111\u01b0\u1ee3c th\u00ec d\u00f9ng workflow g\u1ecdi n8n API l\u01b0u l\u00ean Google Drive, ch\u1ec9 l\u1ea5y \u0111\u01b0\u1ee3c workflow, b\u1ea3n d\u00f9ng th\u1eed n8n Cloud kh\u00f4ng c\u00f3 API\" class=\"wp-image-131723\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-chon-cach.webp 1400w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-chon-cach-300x161.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-chon-cach-1024x549.webp 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-chon-cach-768x411.webp 768w\" sizes=\"(max-width: 1400px) 100vw, 1400px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>C\u00e1ch<\/th><th>L\u1ea5y \u0111\u01b0\u1ee3c<\/th><th>C\u1ea7n g\u00ec<\/th><th>H\u1ee3p v\u1edbi<\/th><\/tr><\/thead><tbody><tr><td>L\u1ec7nh CLI <code>export --backup<\/code><\/td><td>Workflow, credential (m\u00e3 h\u00f3a)<\/td><td>SSH v\u00e0o m\u00e1y ch\u1ee7<\/td><td>VPS t\u1ef1 host<\/td><\/tr><tr><td>Ch\u00e9p volume .n8n + <code>pg_dump<\/code><\/td><td>To\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng, k\u1ec3 c\u1ea3 user v\u00e0 l\u1ecbch s\u1eed ch\u1ea1y<\/td><td>SSH, d\u1eebng n8n khi d\u00f9ng SQLite<\/td><td>Tr\u01b0\u1edbc khi c\u1eadp nh\u1eadt, chuy\u1ec3n m\u00e1y ch\u1ee7<\/td><\/tr><tr><td>Workflow g\u1ecdi n8n API \u2192 Google Drive<\/td><td>Ch\u1ec9 workflow<\/td><td>API key n8n, credential Google<\/td><td>Kh\u00f4ng c\u00f3 SSH, n8n Cloud g\u00f3i tr\u1ea3 ph\u00ed<\/td><\/tr><tr><td>Export tay tr\u00ean giao di\u1ec7n<\/td><td>T\u1eebng workflow<\/td><td>Kh\u00f4ng<\/td><td>L\u01b0u nhanh 1\u20132 workflow (<a href=\"https:\/\/tino.vn\/blog\/cach-import-va-export-workflow-tren-n8n\/\">import v\u00e0 export workflow<\/a>)<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\">So s\u00e1nh c\u00e1c c\u00e1ch backup n8n<\/figcaption><\/figure>\n\n\n\n<h2 id=\"C\u00e1ch_backup_n8n_b\u1eb1ng_l\u1ec7nh_CLI\">C\u00e1ch backup n8n b\u1eb1ng l\u1ec7nh CLI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Backup n8n b\u1eb1ng CLI l\u00e0 ch\u1ea1y l\u1ec7nh <code>n8n export<\/code> b\u00ean trong container: c\u1edd <code>--backup<\/code> t\u01b0\u01a1ng \u0111\u01b0\u01a1ng <code>--all --pretty --separate<\/code>, m\u1ed7i workflow v\u00e0 m\u1ed7i credential th\u00e0nh m\u1ed9t file JSON ri\u00eang (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/use-the-command-line\" rel=\"nofollow noopener\" target=\"_blank\">Use the command line<\/a>). Credential xu\u1ea5t ra v\u1eabn \u1edf d\u1ea1ng m\u00e3 h\u00f3a, n\u00ean \u0111i k\u00e8m kh\u00f3a m\u1edbi kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y trong th\u01b0 m\u1ee5c ch\u1ee9a <code>compose.yaml<\/code>, v\u1edbi service t\u00ean <code>n8n<\/code>. D\u00f9ng hai th\u01b0 m\u1ee5c kh\u00e1c nhau cho workflow v\u00e0 credential: theo docs, <code>import:credentials --separate<\/code> hi\u1ec7n l\u1ed7i khi th\u01b0 m\u1ee5c c\u00f3 l\u1eabn file workflow.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd ~\/n8n-compose\ndocker compose exec -u node n8n n8n export:workflow --backup --output=\/home\/node\/.n8n\/backups\/workflows\/\ndocker compose exec -u node n8n n8n export:credentials --backup --output=\/home\/node\/.n8n\/backups\/credentials\/\n\n# Ch\u00e9p ra m\u00e1y ch\u1ee7, ngo\u00e0i container\ndocker compose cp n8n:\/home\/node\/.n8n\/backups .\/n8n-backup-$(date +%F)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Th\u01b0 m\u1ee5c <code>\/home\/node\/.n8n<\/code> n\u1eb1m trong volume n\u00ean file kh\u00f4ng m\u1ea5t khi t\u1ea1o l\u1ea1i container. B\u1ea3n sao v\u1eabn n\u1eb1m tr\u00ean c\u00f9ng m\u00e1y ch\u1ee7, v\u00ec v\u1eady b\u01b0\u1edbc ti\u1ebfp theo l\u00e0 \u0111\u01b0a n\u00f3 ra n\u01a1i kh\u00e1c.<\/p>\n\n\n\n<h3 id=\"Sao_l\u01b0u_kh\u00f3a_m\u00e3_h\u00f3a_N8N_ENCRYPTION_KEY\">Sao l\u01b0u kh\u00f3a m\u00e3 h\u00f3a N8N_ENCRYPTION_KEY<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">n8n t\u1ea1o kh\u00f3a m\u00e3 h\u00f3a ng\u1eabu nhi\u00ean \u1edf l\u1ea7n ch\u1ea1y \u0111\u1ea7u v\u00e0 l\u01b0u trong file <code>config<\/code> c\u1ee7a th\u01b0 m\u1ee5c .n8n, tr\u1eeb khi b\u1ea1n \u0111\u1eb7t bi\u1ebfn <code>N8N_ENCRYPTION_KEY<\/code> (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/configuration-examples\/set-a-custom-encryption-key\" rel=\"nofollow noopener\" target=\"_blank\">Set a custom encryption key<\/a>). Xem kh\u00f3a \u0111ang d\u00f9ng b\u1eb1ng l\u1ec7nh d\u01b0\u1edbi v\u00e0 c\u1ea5t v\u00e0o tr\u00ecnh qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u, t\u00e1ch kh\u1ecfi n\u01a1i \u0111\u1ec3 file credential.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec n8n cat \/home\/node\/.n8n\/config\n# ho\u1eb7c, n\u1ebfu \u0111\u1eb7t b\u1eb1ng bi\u1ebfn m\u00f4i tr\u01b0\u1eddng\ngrep N8N_ENCRYPTION_KEY .env<\/code><\/pre>\n\n\n\n<h3 id=\"Sao_l\u01b0u_to\u00e0n_b\u1ed9_volume_v\u00e0_database\">Sao l\u01b0u to\u00e0n b\u1ed9 volume v\u00e0 database<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1ec3 kh\u00f4i ph\u1ee5c \u0111\u01b0\u1ee3c c\u1ea3 user, l\u1ecbch s\u1eed ch\u1ea1y v\u00e0 c\u00e0i \u0111\u1eb7t, ch\u00e9p nguy\u00ean volume .n8n v\u00e0 database. V\u1edbi SQLite, d\u1eebng n8n tr\u01b0\u1edbc khi ch\u00e9p \u0111\u1ec3 file database kh\u00f4ng b\u1ecb ghi d\u1edf.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume ls                        # t\u00ecm t\u00ean volume, v\u00ed d\u1ee5 n8n-compose_n8n_data\ndocker compose stop n8n\ndocker run --rm -v n8n-compose_n8n_data:\/data -v \"$PWD\":\/backup alpine \\\n  tar czf \/backup\/n8n_data-$(date +%F).tar.gz -C \/data .\ndocker compose start n8n\n\n# N\u1ebfu d\u00f9ng PostgreSQL (service t\u00ean postgres, user v\u00e0 database n8n)\ndocker compose exec -T postgres pg_dump -U n8n -d n8n &gt; n8n-db-$(date +%F).sql<\/code><\/pre>\n\n\n\n<h3 id=\"Ch\u1ea1y_backup_t\u1ef1_\u0111\u1ed9ng_b\u1eb1ng_cron\">Ch\u1ea1y backup t\u1ef1 \u0111\u1ed9ng b\u1eb1ng cron<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Gom c\u00e1c l\u1ec7nh tr\u00ean v\u00e0o m\u1ed9t script r\u1ed3i \u0111\u1eb7t l\u1ecbch b\u1eb1ng cron. V\u00ed d\u1ee5 d\u01b0\u1edbi ch\u1ea1y 2 gi\u1edd s\u00e1ng m\u1ed7i ng\u00e0y v\u00e0 x\u00f3a b\u1ea3n c\u0169 h\u01a1n 14 ng\u00e0y; t\u1ea7n su\u1ea5t t\u00f9y m\u1ee9c thay \u0111\u1ed5i workflow c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n# \/root\/n8n-backup.sh\nset -e\ncd \/root\/n8n-compose\nD=\/root\/n8n-backups\/$(date +%F)\nmkdir -p \"$D\"\ndocker compose exec -T -u node n8n rm -rf \/home\/node\/.n8n\/backups\ndocker compose exec -T -u node n8n n8n export:workflow --backup --output=\/home\/node\/.n8n\/backups\/workflows\/\ndocker compose exec -T -u node n8n n8n export:credentials --backup --output=\/home\/node\/.n8n\/backups\/credentials\/\ndocker compose cp n8n:\/home\/node\/.n8n\/backups \"$D\/\"\nfind \/root\/n8n-backups -mindepth 1 -maxdepth 1 -type d -mtime +14 -exec rm -rf {} +<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x \/root\/n8n-backup.sh\ncrontab -e\n# th\u00eam d\u00f2ng:\n0 2 * * * \/root\/n8n-backup.sh &gt;&gt; \/var\/log\/n8n-backup.log 2&gt;&amp;1<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1ea9y th\u01b0 m\u1ee5c <code>\/root\/n8n-backups<\/code> l\u00ean Google Drive b\u1eb1ng rclone theo h\u01b0\u1edbng d\u1eabn <a href=\"https:\/\/tino.vn\/blog\/tu-dong-backup-n8n-va-openclaw-len-google-drive\/\">t\u1ef1 \u0111\u1ed9ng backup n8n v\u00e0 OpenClaw l\u00ean Google Drive<\/a>. Kh\u00f3a m\u00e3 h\u00f3a kh\u00f4ng \u0111i c\u00f9ng th\u01b0 m\u1ee5c n\u00e0y.<\/p>\n\n\n\n<h3 id=\"V\u00ec_sao_kh\u00f4ng_backup_credential_b\u1eb1ng_node_Execute_Command?\">V\u00ec sao kh\u00f4ng backup credential b\u1eb1ng node Execute Command?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00e1ch c\u0169 d\u00f9ng node Execute Command ch\u1ea1y <code>n8n export:credentials --all --decrypted<\/code> ra <code>\/tmp<\/code>, \u0111\u1ecdc b\u1eb1ng Read\/Write Files r\u1ed3i t\u1ea3i l\u00ean Google Drive. T\u1eeb n8n 2.0, Execute Command b\u1ecb t\u1eaft m\u1eb7c \u0111\u1ecbnh (n\u1eb1m trong <code>NODES_EXCLUDE<\/code>) v\u00e0 Read\/Write Files ch\u1ec9 \u0111\u1ecdc ghi trong <code>~\/.n8n-files<\/code>, n\u00ean workflow \u0111\u00f3 b\u00e1o l\u1ed7i (<a href=\"https:\/\/docs.n8n.io\/changelog\/v20-breaking-changes\" rel=\"nofollow noopener\" target=\"_blank\">v2.0 breaking changes<\/a>, <a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/configure-n8n\/basic-configuration\/use-environment-variables\/nodes\" rel=\"nofollow noopener\" target=\"_blank\">Nodes environment variables<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u1edd <code>--decrypted<\/code> c\u00f2n ghi m\u1ecdi API key, token, m\u1eadt kh\u1ea9u \u1edf d\u1ea1ng ch\u1eef th\u01b0\u1eddng. \u0110\u1ea9y file \u0111\u00f3 l\u00ean Google Drive l\u00e0 \u0111\u1eb7t to\u00e0n b\u1ed9 quy\u1ec1n truy c\u1eadp d\u1ecbch v\u1ee5 c\u1ee7a b\u1ea1n v\u00e0o m\u1ed9t t\u00e0i kho\u1ea3n Google. Ch\u1ec9 d\u00f9ng <code>--decrypted<\/code> khi chuy\u1ec3n sang m\u00e1y c\u00f3 kh\u00f3a kh\u00e1c, v\u00e0 x\u00f3a file ngay sau khi kh\u00f4i ph\u1ee5c.<\/p>\n\n\n\n<h2 id=\"C\u00e1ch_backup_workflow_n8n_l\u00ean_Google_Drive_b\u1eb1ng_workflow\">C\u00e1ch backup workflow n8n l\u00ean Google Drive b\u1eb1ng workflow<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Workflow backup l\u00ean Google Drive d\u00f9ng node n8n (g\u1ecdi n8n API) \u0111\u1ec3 l\u1ea5y danh s\u00e1ch workflow, node Convert to File \u0111\u1ec3 \u0111\u1ed5i sang JSON, r\u1ed3i node Google Drive \u0111\u1ec3 t\u1ea3i l\u00ean theo l\u1ecbch. C\u00e1ch n\u00e0y ch\u1ea1y \u0111\u01b0\u1ee3c c\u1ea3 khi kh\u00f4ng c\u00f3 SSH, nh\u01b0ng ch\u1ec9 l\u1ea5y workflow. n8n API kh\u00f4ng c\u00f3 \u1edf b\u1ea3n d\u00f9ng th\u1eed n8n Cloud (<a href=\"https:\/\/docs.n8n.io\/connect\/n8n-api\/authentication\" rel=\"nofollow noopener\" target=\"_blank\">n8n API Authentication<\/a>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u1ea2nh ch\u1ee5p \u1edf n8n 1.x. \u1ede n8n 2.x, n\u00fat Test workflow \u0111\u1ed5i th\u00e0nh Execute workflow, c\u00f4ng t\u1eafc Active\/Inactive thay b\u1eb1ng n\u00fat Publish; c\u00e1c node v\u00e0 tr\u01b0\u1eddng c\u1ea5u h\u00ecnh gi\u1eef nguy\u00ean.<\/em><\/p>\n\n\n\n<h3 id=\"C\u00e1ch_1:_Backup_to\u00e0n_b\u1ed9_workflow_v\u00e0o_m\u1ed9t_file\">C\u00e1ch 1: Backup to\u00e0n b\u1ed9 workflow v\u00e0o m\u1ed9t file<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 1: C\u1ea5u h\u00ecnh Schedule Trigger.<\/strong> Th\u00eam node Schedule Trigger v\u00e0 \u0111\u1eb7t l\u1ecbch ch\u1ea1y. V\u00ed d\u1ee5 3 ng\u00e0y m\u1ed9t l\u1ea7n l\u00fac n\u1eeda \u0111\u00eam: Trigger Interval l\u00e0 Days, Days Between Triggers l\u00e0 3, Trigger at Hour l\u00e0 Midnight, Trigger at Minute l\u00e0 0.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1060\" height=\"622\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-4.png\" alt=\"Node Schedule Trigger \u0111\u1eb7t Trigger Interval Days, Days Between Triggers 3, Trigger at Hour Midnight, Trigger at Minute 0\" class=\"wp-image-116446\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-4.png 1060w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-4-300x176.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-4-1024x601.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-4-768x451.png 768w\" sizes=\"(max-width: 1060px) 100vw, 1060px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 2: T\u1ea1o API key n8n.<\/strong> Nh\u1ea5p bi\u1ec3u t\u01b0\u1ee3ng Settings \u1edf g\u00f3c d\u01b0\u1edbi thanh b\u00ean tr\u00e1i, ch\u1ecdn m\u1ee5c n8n API.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"490\" height=\"427\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-5.png\" alt=\"Menu Settings \u1edf g\u00f3c d\u01b0\u1edbi b\u00ean tr\u00e1i giao di\u1ec7n n8n\" class=\"wp-image-116447\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-5.png 490w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-5-300x261.png 300w\" sizes=\"(max-width: 490px) 100vw, 490px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1174\" height=\"622\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-6.png\" alt=\"Trang Settings c\u1ee7a n8n, m\u1ee5c n8n API v\u00e0 n\u00fat Create an API Key\" class=\"wp-image-116448\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-6.png 1174w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-6-300x159.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-6-1024x543.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-6-768x407.png 768w\" sizes=\"(max-width: 1174px) 100vw, 1174px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Nh\u1ea5p Create an API Key, nh\u1eadp Label (v\u00ed d\u1ee5 Backup), ch\u1ecdn th\u1eddi h\u1ea1n Expiration r\u1ed3i b\u1ea5m Save. \u1ede g\u00f3i Enterprise, ch\u1ec9 c\u1ea5p scope \u0111\u1ecdc workflow cho key n\u00e0y.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"950\" height=\"561\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-7.png\" alt=\"H\u1ed9p tho\u1ea1i Create API Key v\u1edbi Label Backup, Expiration 30 days v\u00e0 n\u00fat Save\" class=\"wp-image-116449\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-7.png 950w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-7-300x177.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-7-768x454.png 768w\" sizes=\"(max-width: 950px) 100vw, 950px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">n8n ch\u1ec9 hi\u1ec7n API key m\u1ed9t l\u1ea7n. Sao ch\u00e9p key ngay r\u1ed3i b\u1ea5m Done; m\u1ea5t key th\u00ec x\u00f3a v\u00e0 t\u1ea1o key m\u1edbi.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"794\" height=\"488\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-01.webp\" alt=\"H\u1ed9p tho\u1ea1i API Key Created c\u1ee7a n8n, ph\u1ea7n chu\u1ed7i API key \u0111\u00e3 \u0111\u01b0\u1ee3c che, n\u00fat Done\" class=\"wp-image-131724\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-01.webp 794w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-01-300x184.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-01-768x472.webp 768w\" sizes=\"(max-width: 794px) 100vw, 794px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 3: C\u1ea5u h\u00ecnh node n8n \u0111\u1ec3 l\u1ea5y workflow.<\/strong> Th\u00eam node n8n sau Schedule Trigger.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"943\" height=\"531\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-9.png\" alt=\"Ch\u1ecdn node n8n trong b\u1ea3ng node, ph\u1ea7n Workflow actions\" class=\"wp-image-116451\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-9.png 943w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-9-300x169.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-9-768x432.png 768w\" sizes=\"(max-width: 943px) 100vw, 943px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u1ea2nh ch\u1ee5p \u1edf n8n 1.x: thanh tr\u00ean c\u00f2n c\u00f4ng t\u1eafc Inactive, \u1edf n8n 2.x l\u00e0 n\u00fat Publish.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede Credential to connect with, t\u1ea1o credential n8n account: d\u00e1n API key \u1edf b\u01b0\u1edbc 2 v\u00e0 Base URL c\u1ee7a b\u1ea1n, d\u1ea1ng <code>https:\/\/n8n.example.com\/api\/v1<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1018\" height=\"610\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-02.webp\" alt=\"Credential n8n account trong n8n: \u00f4 API Key \u0111\u00e3 \u1ea9n v\u00e0 Base URL https:\/\/n8n.example.com\/api\/v1\" class=\"wp-image-131725\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-02.webp 1018w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-02-300x180.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-02-768x460.webp 768w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">L\u01b0u credential, r\u1ed3i \u0111\u1eb7t Resource l\u00e0 Workflow, Operation l\u00e0 Get Many v\u00e0 b\u1eadt Return All \u0111\u1ec3 l\u1ea5y m\u1ecdi workflow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1073\" height=\"619\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-11.png\" alt=\"Node n8n \u0111\u1eb7t Resource Workflow, Operation Get Many, b\u1eadt Return All\" class=\"wp-image-116453\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-11.png 1073w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-11-300x173.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-11-1024x591.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-11-768x443.png 768w\" sizes=\"(max-width: 1073px) 100vw, 1073px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 4: Chuy\u1ec3n d\u1eef li\u1ec7u sang JSON.<\/strong> Th\u00eam node Convert to File sau node n8n, \u0111\u1eb7t Operation l\u00e0 Convert to JSON, Mode l\u00e0 All Items to One File, Put Output File in Field gi\u1eef l\u00e0 data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"882\" height=\"525\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-12.png\" alt=\"Th\u00eam node Convert to File sau node n8n\" class=\"wp-image-116454\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-12.png 882w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-12-300x179.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-12-768x457.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1123\" height=\"619\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-13.png\" alt=\"Node Convert to File \u0111\u1eb7t Convert to JSON, All Items to One File, tr\u01b0\u1eddng data\" class=\"wp-image-116455\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-13.png 1123w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-13-300x165.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-13-1024x564.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-13-768x423.png 768w\" sizes=\"(max-width: 1123px) 100vw, 1123px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 5: C\u1ea5u h\u00ecnh node Google Drive.<\/strong> Th\u00eam node Google Drive, ch\u1ecdn credential Google (xem <a href=\"https:\/\/tino.vn\/blog\/cach-xac-thuc-credential-cho-google-tren-n8n\/\">c\u00e1ch x\u00e1c th\u1ef1c credential cho Google tr\u00ean n8n<\/a>). \u0110\u1eb7t Resource l\u00e0 File, Operation l\u00e0 Upload, Input Data Field Name l\u00e0 data, File Name l\u00e0 Data, Parent Drive l\u00e0 My Drive, Parent Folder l\u00e0 th\u01b0 m\u1ee5c Backup (ch\u1ecdn t\u1eeb danh s\u00e1ch ho\u1eb7c d\u00e1n URL).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"924\" height=\"620\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-03.webp\" alt=\"Node Google Drive \u0111\u1eb7t File, Upload, tr\u01b0\u1eddng data, t\u00ean file Data, My Drive v\u00e0 th\u01b0 m\u1ee5c theo URL; ID file \u1edf ph\u1ea7n Output \u0111\u00e3 \u0111\u01b0\u1ee3c l\u00e0m m\u1edd\" class=\"wp-image-131726\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-03.webp 924w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-03-300x201.webp 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/cach-backup-va-restore-workflow-n8n-sua-03-768x515.webp 768w\" sizes=\"(max-width: 924px) 100vw, 924px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 6: L\u01b0u v\u00e0 ch\u1ea1y th\u1eed.<\/strong> \u0110\u1eb7t t\u00ean workflow, b\u1ea5m Save, r\u1ed3i ch\u1ea1y th\u1eed m\u1ed9t l\u1ea7n v\u00e0 m\u1edf th\u01b0 m\u1ee5c Backup tr\u00ean Google Drive \u0111\u1ec3 xem file Data.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1145\" height=\"624\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-15.png\" alt=\"Workflow Backup all workflow g\u1ed3m Schedule Trigger, n8n, Convert to File v\u00e0 Google Drive, n\u00fat Save v\u00e0 Test workflow\" class=\"wp-image-116457\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-15.png 1145w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-15-300x163.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-15-1024x558.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-15-768x419.png 768w\" sizes=\"(max-width: 1145px) 100vw, 1145px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"819\" height=\"523\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-16.png\" alt=\"Th\u01b0 m\u1ee5c Backup tr\u00ean Google Drive c\u00f3 file Data v\u1eeba t\u1ea3i l\u00ean\" class=\"wp-image-116458\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-16.png 819w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-16-300x192.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-16-768x490.png 768w\" sizes=\"(max-width: 819px) 100vw, 819px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y \u1ed5n th\u00ec b\u1ea5m Publish \u0111\u1ec3 workflow t\u1ef1 ch\u1ea1y theo l\u1ecbch. V\u1edbi n8n 1.x, b\u1eadt c\u00f4ng t\u1eafc Active.<\/p>\n\n\n\n<h3 id=\"C\u00e1ch_2:_Backup_t\u1eebng_workflow_th\u00e0nh_file_ri\u00eang\">C\u00e1ch 2: Backup t\u1eebng workflow th\u00e0nh file ri\u00eang<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00e1ch 2 t\u1ea1o m\u1ed9t th\u01b0 m\u1ee5c m\u1edbi tr\u00ean Google Drive cho m\u1ed7i l\u1ea7n ch\u1ea1y v\u00e0 l\u01b0u m\u1ed7i workflow m\u1ed9t file mang t\u00ean workflow. Kh\u00f4i ph\u1ee5c m\u1ed9t workflow l\u1ebb s\u1ebd nhanh h\u01a1n, v\u00e0 d\u1ec5 so c\u00e1c b\u1ea3n theo th\u1eddi gian.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 1:<\/strong> Th\u00eam Schedule Trigger nh\u01b0 C\u00e1ch 1.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 2: T\u1ea1o th\u01b0 m\u1ee5c theo th\u1eddi gian.<\/strong> Th\u00eam node Google Drive (\u0111\u1ed5i t\u00ean th\u00e0nh Create Folder), \u0111\u1eb7t Resource l\u00e0 Folder, Operation l\u00e0 Create, Folder Name l\u00e0 <code>{{ $json.timestamp }}<\/code>, Parent Folder l\u00e0 th\u01b0 m\u1ee5c g\u1ed1c ch\u1ee9a c\u00e1c b\u1ea3n backup.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1069\" height=\"602\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-19.png\" alt=\"Node Google Drive Create Folder \u0111\u1eb7t Resource Folder, Operation Create, Folder Name l\u00e0 bi\u1ec3u th\u1ee9c $json.timestamp\" class=\"wp-image-116461\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-19.png 1069w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-19-300x169.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-19-1024x577.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-19-768x432.png 768w\" sizes=\"(max-width: 1069px) 100vw, 1069px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 3: L\u1ea5y m\u1ecdi workflow.<\/strong> Th\u00eam node n8n (\u0111\u1ed5i t\u00ean th\u00e0nh Get All WF), d\u00f9ng credential n8n account, Resource l\u00e0 Workflow, Operation l\u00e0 Get Many, b\u1eadt Return All.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"979\" height=\"613\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-20.png\" alt=\"Node n8n t\u00ean Get All WF \u0111\u1eb7t Workflow, Get Many, b\u1eadt Return All\" class=\"wp-image-116462\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-20.png 979w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-20-300x188.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-20-768x481.png 768w\" sizes=\"(max-width: 979px) 100vw, 979px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 4: M\u1ed7i workflow m\u1ed9t file JSON.<\/strong> Th\u00eam Convert to File, \u0111\u1eb7t Operation l\u00e0 Convert to JSON, Mode l\u00e0 Each Item to Separate File.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1084\" height=\"612\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-21.png\" alt=\"Node Convert to File \u0111\u1eb7t Convert to JSON, Each Item to Separate File\" class=\"wp-image-116463\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-21.png 1084w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-21-300x169.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-21-1024x578.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-21-768x434.png 768w\" sizes=\"(max-width: 1084px) 100vw, 1084px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 5: \u0110\u1eb7t t\u00ean file.<\/strong> Th\u00eam node Code (v\u00ed d\u1ee5 t\u00ean Dat_Ten), Mode l\u00e0 Run Once for All Items, ng\u00f4n ng\u1eef JavaScript. \u0110o\u1ea1n m\u00e3 g\u00e1n t\u00ean t\u1ea1m Backup-1.json, Backup-2.json cho t\u1eebng file; \u1edf b\u01b0\u1edbc 6, \u00f4 File Name s\u1ebd \u0111\u1ed5i th\u00e0nh t\u00ean workflow.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>return items.map((item, index) =&gt; {\n  item.binary.data.fileName = `Backup-${index + 1}.json`;\n  return item;\n});<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"882\" height=\"552\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-22.png\" alt=\"Node Code t\u00ean Dat_Ten ch\u1ea1y Run Once for All Items, \u0111o\u1ea1n JavaScript \u0111\u1eb7t t\u00ean file backup\" class=\"wp-image-116464\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-22.png 882w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-22-300x188.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-22-768x481.png 768w\" sizes=\"(max-width: 882px) 100vw, 882px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 6: T\u1ea3i l\u00ean Google Drive.<\/strong> Th\u00eam node Google Drive, Resource l\u00e0 File, Operation l\u00e0 Upload, Input Data Field Name l\u00e0 data. File Name l\u00e0 <code>{{ $('Get All WF').item.json.name }}<\/code>, Parent Folder ch\u1ecdn By ID v\u1edbi <code>{{ $('Create Folder').item.json.id }}<\/code> \u0111\u1ec3 file v\u00e0o \u0111\u00fang th\u01b0 m\u1ee5c v\u1eeba t\u1ea1o.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1081\" height=\"614\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-23.png\" alt=\"Node Google Drive t\u1ea3i file l\u00ean th\u01b0 m\u1ee5c theo ID c\u1ee7a node Create Folder, t\u00ean file theo t\u00ean workflow\" class=\"wp-image-116465\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-23.png 1081w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-23-300x170.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-23-1024x582.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-23-768x436.png 768w\" sizes=\"(max-width: 1081px) 100vw, 1081px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>B\u01b0\u1edbc 7: L\u01b0u v\u00e0 ch\u1ea1y th\u1eed.<\/strong> M\u1ed7i l\u1ea7n ch\u1ea1y, Google Drive c\u00f3 th\u00eam m\u1ed9t th\u01b0 m\u1ee5c mang d\u1ea5u th\u1eddi gian, b\u00ean trong l\u00e0 t\u1eebng workflow.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1304\" height=\"620\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-24.png\" alt=\"Workflow backup t\u1eebng workflow g\u1ed3m Schedule Trigger, Create Folder, Get All WF, Convert to File, Dat_Ten v\u00e0 Google Drive\" class=\"wp-image-116466\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-24.png 1304w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-24-300x143.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-24-1024x487.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-24-768x365.png 768w\" sizes=\"(max-width: 1304px) 100vw, 1304px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"835\" height=\"459\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-25.png\" alt=\"Th\u01b0 m\u1ee5c Backup tr\u00ean Google Drive c\u00f3 th\u01b0 m\u1ee5c con \u0111\u1eb7t t\u00ean theo th\u1eddi gian ch\u1ea1y\" class=\"wp-image-116467\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-25.png 835w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-25-300x165.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-25-768x422.png 768w\" sizes=\"(max-width: 835px) 100vw, 835px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1030\" height=\"552\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-26.png\" alt=\"Th\u01b0 m\u1ee5c backup theo th\u1eddi gian ch\u1ee9a t\u1eebng file workflow nh\u01b0 Backup all workflow, Chatbot FB, HTTP\" class=\"wp-image-116468\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-26.png 1030w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-26-300x161.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-26-1024x549.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/word-image-116442-26-768x412.png 768w\" sizes=\"(max-width: 1030px) 100vw, 1030px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y \u1ed5n th\u00ec b\u1ea5m Publish. Hai file workflow m\u1eabu t\u1eebng chia s\u1ebb tr\u00ean Google Drive kh\u00f4ng c\u00f2n truy c\u1eadp \u0111\u01b0\u1ee3c, n\u00ean h\u00e3y d\u1ef1ng theo c\u00e1c b\u01b0\u1edbc tr\u00ean.<\/p>\n\n\n\n<h2 id=\"C\u00e1ch_restore_workflow_v\u00e0_credential_n8n\">C\u00e1ch restore workflow v\u00e0 credential n8n<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Restore n8n c\u00f3 ba m\u1ee9c: nh\u1eadp workflow v\u00e0 credential t\u1eeb file CLI, nh\u1eadp m\u1ed9t file JSON tr\u00ean giao di\u1ec7n, ho\u1eb7c kh\u00f4i ph\u1ee5c c\u1ea3 h\u1ec7 th\u1ed1ng t\u1eeb volume v\u00e0 database. D\u00f9 ch\u1ecdn m\u1ee9c n\u00e0o, credential ch\u1ec9 d\u00f9ng \u0111\u01b0\u1ee3c khi m\u00e1y \u0111\u00edch c\u00f3 c\u00f9ng kh\u00f3a m\u00e3 h\u00f3a v\u1edbi m\u00e1y \u0111\u00e3 xu\u1ea5t.<\/p>\n\n\n\n<h3 id=\"Restore_b\u1eb1ng_l\u1ec7nh_import_c\u1ee7a_n8n\">Restore b\u1eb1ng l\u1ec7nh import c\u1ee7a n8n<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Tr\u00ean m\u00e1y m\u1edbi, ho\u00e0n t\u1ea5t t\u1ea1o t\u00e0i kho\u1ea3n owner tr\u01b0\u1edbc, v\u00ec l\u1ec7nh import c\u1ea7n m\u1ed9t user c\u00f3 s\u1eb5n. \u0110\u1eb7t c\u00f9ng <code>N8N_ENCRYPTION_KEY<\/code> ho\u1eb7c ch\u00e9p file config c\u0169 v\u00e0o .n8n, r\u1ed3i ch\u00e9p th\u01b0 m\u1ee5c backup v\u00e0o volume v\u00e0 ch\u1ea1y l\u1ec7nh (<a href=\"https:\/\/docs.n8n.io\/deploy\/host-n8n\/keep-n8n-running\/backup-and-restore\" rel=\"nofollow noopener\" target=\"_blank\">Back up and restore<\/a>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose cp .\/n8n-backup-2026-10-23\/backups n8n:\/home\/node\/.n8n\/\ndocker compose exec -u node n8n n8n import:credentials --separate --input=\/home\/node\/.n8n\/backups\/credentials\/\ndocker compose exec -u node n8n n8n import:workflow --separate --input=\/home\/node\/.n8n\/backups\/workflows\/\ndocker compose restart n8n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Workflow nh\u1eadp v\u00e0o b\u1ecb t\u1eaft s\u1eb5n. M\u1edf t\u1eebng workflow c\u1ea7n ch\u1ea1y v\u00e0 b\u1ea5m Publish.<\/li>\n\n\n<li>File export gi\u1eef nguy\u00ean ID. M\u00e1y \u0111\u00edch c\u00f3 workflow ho\u1eb7c credential c\u00f9ng ID s\u1ebd b\u1ecb ghi \u0111\u00e8.<\/li>\n\n\n<li>C\u00f3 nhi\u1ec1u user ho\u1eb7c project th\u00ec th\u00eam <code>--userId<\/code> ho\u1eb7c <code>--projectId<\/code> \u0111\u1ec3 g\u00e1n ch\u1ee7 s\u1edf h\u1eefu.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi import, m\u1edf m\u1ee5c Credentials \u0111\u1ec3 ki\u1ec3m tra \u0111\u1ee7 danh s\u00e1ch v\u00e0 th\u1eed m\u1ed9t node d\u00f9ng t\u1eebng credential.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"879\" height=\"426\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/6-5.png\" alt=\"Tab Credentials c\u1ee7a n8n sau khi kh\u00f4i ph\u1ee5c, danh s\u00e1ch credential Google Drive, n8n account, Zalo API, Google Sheets\" class=\"wp-image-117995\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/6-5.png 879w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/6-5-300x145.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/6-5-768x372.png 768w\" sizes=\"(max-width: 879px) 100vw, 879px\" \/><\/figure>\n\n\n\n<h3 id=\"Restore_workflow_t\u1eeb_file_JSON_tr\u00ean_Google_Drive\">Restore workflow t\u1eeb file JSON tr\u00ean Google Drive<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">T\u1ea3i file backup v\u1ec1 m\u00e1y (chu\u1ed9t ph\u1ea3i v\u00e0o file tr\u00ean Google Drive, ch\u1ecdn T\u1ea3i xu\u1ed1ng). File c\u1ee7a C\u00e1ch 2 ch\u1ee9a m\u1ed9t workflow, nh\u1eadp b\u1eb1ng Import from File tr\u00ean giao di\u1ec7n theo h\u01b0\u1edbng d\u1eabn <a href=\"https:\/\/tino.vn\/blog\/cach-import-va-export-workflow-tren-n8n\/\">import v\u00e0 export workflow tr\u00ean n8n<\/a>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"867\" height=\"622\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/3.png\" alt=\"Menu chu\u1ed9t ph\u1ea3i tr\u00ean Google Drive v\u1edbi l\u1ef1a ch\u1ecdn T\u1ea3i xu\u1ed1ng file backup Data\" class=\"wp-image-117977\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/3.png 867w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/3-300x215.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/3-768x551.png 768w\" sizes=\"(max-width: 867px) 100vw, 867px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">File Data c\u1ee7a C\u00e1ch 1 l\u00e0 m\u1ed9t m\u1ea3ng nhi\u1ec1u workflow. Ch\u00e9p file l\u00ean m\u00e1y ch\u1ee7 r\u1ed3i ch\u1ea1y <code>n8n import:workflow --input=Data.json<\/code>; n\u1ebfu l\u1ec7nh b\u00e1o l\u1ed7i \u0111\u1ecbnh d\u1ea1ng, t\u00e1ch t\u1eebng ph\u1ea7n t\u1eed c\u1ee7a m\u1ea3ng ra file ri\u00eang r\u1ed3i import theo th\u01b0 m\u1ee5c.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/image.png\" alt=\"Danh s\u00e1ch workflow trong n8n sau khi kh\u00f4i ph\u1ee5c, g\u1ed3m Kh\u00f4i ph\u1ee5c, backup credential, Backup t\u1eebng wf ri\u00eang, Backup all workflow\" class=\"wp-image-117982\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/image.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/image-300x171.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2025\/07\/image-768x438.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><em>\u1ea2nh ch\u1ee5p \u1edf n8n 1.x n\u00ean m\u1ed7i workflow c\u00f3 c\u00f4ng t\u1eafc Inactive; \u1edf n8n 2.x, workflow ch\u01b0a Publish hi\u1ec7n tr\u1ea1ng th\u00e1i t\u01b0\u01a1ng \u1ee9ng.<\/em><\/p>\n\n\n\n<h3 id=\"Restore_to\u00e0n_b\u1ed9_h\u1ec7_th\u1ed1ng_n8n\">Restore to\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng n8n<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Kh\u00f4i ph\u1ee5c to\u00e0n b\u1ed9 h\u1ec7 th\u1ed1ng \u0111\u01b0a l\u1ea1i c\u1ea3 user, l\u1ecbch s\u1eed ch\u1ea1y v\u00e0 c\u00e0i \u0111\u1eb7t. L\u00e0m theo th\u1ee9 t\u1ef1:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>D\u1eebng n8n: <code>docker compose stop n8n<\/code>.<\/li>\n\n\n<li>Gi\u1ea3i n\u00e9n b\u1ea3n sao volume v\u00e0o volume n8n_data (v\u00e0 c\u00e1c th\u01b0 m\u1ee5c custom node n\u1ebfu c\u00f3).<\/li>\n\n\n<li>Kh\u00f4i ph\u1ee5c PostgreSQL t\u1eeb file <code>pg_dump<\/code> n\u1ebfu d\u00f9ng.<\/li>\n\n\n<li>\u0110\u1eb7t l\u1ea1i <code>.env<\/code>: bi\u1ebfn k\u1ebft n\u1ed1i database, <code>N8N_ENCRYPTION_KEY<\/code> n\u1ebfu t\u1ef1 \u0111\u1eb7t.<\/li>\n\n\n<li>Kh\u1edfi \u0111\u1ed9ng: <code>docker compose up -d<\/code>, r\u1ed3i \u0111\u0103ng nh\u1eadp ki\u1ec3m tra.<\/li>\n<\/ol>\n\n\n\n<h2 id=\"L\u00e0m_sao_bi\u1ebft_b\u1ea3n_backup_n8n_d\u00f9ng_\u0111\u01b0\u1ee3c?\">L\u00e0m sao bi\u1ebft b\u1ea3n backup n8n d\u00f9ng \u0111\u01b0\u1ee3c?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">B\u1ea3n backup n8n ch\u1ec9 \u0111\u00e1ng tin khi b\u1ea1n \u0111\u00e3 kh\u00f4i ph\u1ee5c th\u1eed n\u00f3 \u00edt nh\u1ea5t m\u1ed9t l\u1ea7n. D\u1ef1ng m\u1ed9t n8n tr\u1ed1ng tr\u00ean m\u00e1y th\u1eed, nh\u1eadp b\u1ea3n backup, r\u1ed3i ki\u1ec3m tra c\u00e1c \u0111i\u1ec3m d\u01b0\u1edbi. N\u1ebfu \u0111ang \u0111\u1ecbnh \u0111\u1ed5i database, \u0111\u1ecdc th\u00eam <a href=\"https:\/\/tino.vn\/blog\/doi-database-n8n-tu-sqlite-sang-postgresql\/\">\u0111\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>S\u1ed1 workflow v\u00e0 credential kh\u1edbp v\u1edbi m\u00e1y g\u1ed1c.<\/li>\n\n\n<li>M\u1edf m\u1ed9t credential kh\u00f4ng b\u00e1o l\u1ed7i gi\u1ea3i m\u00e3 (ngh\u0129a l\u00e0 kh\u00f3a \u0111\u00fang).<\/li>\n\n\n<li>Ch\u1ea1y th\u1eed m\u1ed9t workflow c\u00f3 webhook v\u00e0 m\u1ed9t workflow theo l\u1ecbch.<\/li>\n\n\n<li>Kh\u00f3a m\u00e3 h\u00f3a v\u00e0 API key \u0111\u01b0\u1ee3c c\u1ea5t ri\u00eang, kh\u00f4ng n\u1eb1m chung th\u01b0 m\u1ee5c backup (<a href=\"https:\/\/tino.vn\/blog\/bao-mat-credentials-va-api-keys-trong-n8n\/\">b\u1ea3o m\u1eadt credentials v\u00e0 API key trong n8n<\/a>).<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">Mu\u1ed1n ch\u1ea1y n8n 24\/7 m\u00e0 kh\u00f4ng t\u1ef1 c\u00e0i? <a href=\"https:\/\/tino.vn\/vps-n8n\">VPS n8n c\u1ee7a Tino<\/a> c\u00e0i s\u1eb5n n8n tr\u00ean VPS NVMe \u0111\u1eb7t t\u1ea1i Vi\u1ec7t Nam; b\u1ea1n v\u1eabn c\u00f3 quy\u1ec1n root \u0111\u1ec3 c\u1ea5u h\u00ecnh. Xem c\u1ea5u h\u00ecnh v\u00e0 gi\u00e1 tr\u00ean trang s\u1ea3n ph\u1ea9m.<\/p>\n<\/blockquote>\n\n\n\n<h2 id=\"C\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p\">C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/h2>\n\n\n\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"N\u00ean_backup_n8n_bao_l\u00e2u_m\u1ed9t_l\u1ea7n?\">N\u00ean backup n8n bao l\u00e2u m\u1ed9t l\u1ea7n?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">T\u00f9y t\u1ea7n su\u1ea5t b\u1ea1n s\u1eeda workflow. H\u1ec7 th\u1ed1ng thay \u0111\u1ed5i h\u1eb1ng ng\u00e0y n\u00ean backup h\u1eb1ng ng\u00e0y b\u1eb1ng cron; ngo\u00e0i ra lu\u00f4n sao l\u01b0u \u0111\u1ea7y \u0111\u1ee7 tr\u01b0\u1edbc m\u1ed7i l\u1ea7n c\u1eadp nh\u1eadt n8n. L\u1ecbch ch\u1ea1y ch\u1ec9nh \u1edf cron ho\u1eb7c \u1edf node Schedule Trigger.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"API_key_n8n_d\u00f9ng_\u0111\u1ec3_l\u00e0m_g\u00ec_trong_workflow_backup?\">API key n8n d\u00f9ng \u0111\u1ec3 l\u00e0m g\u00ec trong workflow backup?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">API key cho node n8n \u0111\u1ecdc danh s\u00e1ch workflow qua n8n API. n8n ch\u1ec9 hi\u1ec7n key m\u1ed9t l\u1ea7n l\u00fac t\u1ea1o; m\u1ea5t key th\u00ec x\u00f3a key c\u0169 \u1edf Settings > n8n API v\u00e0 t\u1ea1o key m\u1edbi.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"Base_URL_c\u1ee7a_n8n_l\u00e0_g\u00ec?\">Base URL c\u1ee7a n8n l\u00e0 g\u00ec?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Base URL l\u00e0 \u0111\u1ecba ch\u1ec9 API c\u1ee7a b\u1ea3n n8n b\u1ea1n \u0111ang d\u00f9ng, d\u1ea1ng https:\/\/n8n.example.com\/api\/v1 v\u1edbi b\u1ea3n t\u1ef1 host, ho\u1eb7c https:\/\/ten.app.n8n.cloud\/api\/v1 v\u1edbi n8n Cloud.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"C\u00f3_backup_l\u00ean_Dropbox,_OneDrive_hay_Amazon_S3_\u0111\u01b0\u1ee3c_kh\u00f4ng?\">C\u00f3 backup l\u00ean Dropbox, OneDrive hay Amazon S3 \u0111\u01b0\u1ee3c kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">\u0110\u01b0\u1ee3c. Trong workflow, thay node Google Drive b\u1eb1ng node Dropbox, Microsoft OneDrive ho\u1eb7c AWS S3. V\u1edbi c\u00e1ch CLI, rclone h\u1ed7 tr\u1ee3 c\u1ea3 ba d\u1ecbch v\u1ee5 n\u00e0y.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"C\u00f3_n\u00ean_xu\u1ea5t_credential_d\u1ea1ng_gi\u1ea3i_m\u00e3_\u0111\u1ec3_d\u1ec5_\u0111\u1ecdc_kh\u00f4ng?\">C\u00f3 n\u00ean xu\u1ea5t credential d\u1ea1ng gi\u1ea3i m\u00e3 \u0111\u1ec3 d\u1ec5 \u0111\u1ecdc kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">Kh\u00f4ng n\u00ean. C\u1edd &#8211;decrypted ghi m\u1ecdi kh\u00f3a v\u00e0 token \u1edf d\u1ea1ng ch\u1eef th\u01b0\u1eddng. Ch\u1ec9 d\u00f9ng khi chuy\u1ec3n sang m\u00e1y c\u00f3 kh\u00f3a m\u00e3 h\u00f3a kh\u00e1c, v\u00e0 x\u00f3a file ngay sau khi kh\u00f4i ph\u1ee5c.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section\t\thelp class=\"sc_fs_faq sc_card    \"\n\t\t\t\t>\n\t\t\t\t<h2 id=\"n8n_Cloud_c\u00f3_c\u1ea7n_t\u1ef1_backup_kh\u00f4ng?\">n8n Cloud c\u00f3 c\u1ea7n t\u1ef1 backup kh\u00f4ng?<\/h2>\t\t\t\t<div>\n\t\t\t\t\t\t<div class=\"sc_fs_faq__content\">\n\t\t\t\t\n\n<p class=\"wp-block-paragraph\">n8n Cloud kh\u00f4ng c\u00f3 CLI hay volume \u0111\u1ec3 ch\u00e9p. B\u1ea1n c\u00f3 th\u1ec3 export t\u1eebng workflow tr\u00ean giao di\u1ec7n ho\u1eb7c d\u00f9ng workflow g\u1ecdi n8n API \u1edf g\u00f3i tr\u1ea3 ph\u00ed; credential ph\u1ea3i ghi l\u1ea1i theo c\u00e1ch ri\u00eang.<\/p>\n\n\t\t\t<\/div>\n\t\t<\/div>\n\t\t<\/section>\n\t\t\n<script type=\"application\/ld+json\">\n\t{\n\t\t\"@context\": \"https:\/\/schema.org\",\n\t\t\"@type\": \"FAQPage\",\n\t\t\"mainEntity\": [\n\t\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"N\u00ean backup n8n bao l\u00e2u m\u1ed9t l\u1ea7n?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>T\u00f9y t\u1ea7n su\u1ea5t b\u1ea1n s\u1eeda workflow. H\u1ec7 th\u1ed1ng thay \u0111\u1ed5i h\u1eb1ng ng\u00e0y n\u00ean backup h\u1eb1ng ng\u00e0y b\u1eb1ng cron; ngo\u00e0i ra lu\u00f4n sao l\u01b0u \u0111\u1ea7y \u0111\u1ee7 tr\u01b0\u1edbc m\u1ed7i l\u1ea7n c\u1eadp nh\u1eadt n8n. L\u1ecbch ch\u1ea1y ch\u1ec9nh \u1edf cron ho\u1eb7c \u1edf node Schedule Trigger.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"API key n8n d\u00f9ng \u0111\u1ec3 l\u00e0m g\u00ec trong workflow backup?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>API key cho node n8n \u0111\u1ecdc danh s\u00e1ch workflow qua n8n API. n8n ch\u1ec9 hi\u1ec7n key m\u1ed9t l\u1ea7n l\u00fac t\u1ea1o; m\u1ea5t key th\u00ec x\u00f3a key c\u0169 \u1edf Settings > n8n API v\u00e0 t\u1ea1o key m\u1edbi.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"Base URL c\u1ee7a n8n l\u00e0 g\u00ec?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Base URL l\u00e0 \u0111\u1ecba ch\u1ec9 API c\u1ee7a b\u1ea3n n8n b\u1ea1n \u0111ang d\u00f9ng, d\u1ea1ng https:\/\/n8n.example.com\/api\/v1 v\u1edbi b\u1ea3n t\u1ef1 host, ho\u1eb7c https:\/\/ten.app.n8n.cloud\/api\/v1 v\u1edbi n8n Cloud.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"C\u00f3 backup l\u00ean Dropbox, OneDrive hay Amazon S3 \u0111\u01b0\u1ee3c kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>\u0110\u01b0\u1ee3c. Trong workflow, thay node Google Drive b\u1eb1ng node Dropbox, Microsoft OneDrive ho\u1eb7c AWS S3. V\u1edbi c\u00e1ch CLI, rclone h\u1ed7 tr\u1ee3 c\u1ea3 ba d\u1ecbch v\u1ee5 n\u00e0y.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"C\u00f3 n\u00ean xu\u1ea5t credential d\u1ea1ng gi\u1ea3i m\u00e3 \u0111\u1ec3 d\u1ec5 \u0111\u1ecdc kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>Kh\u00f4ng n\u00ean. C\u1edd --decrypted ghi m\u1ecdi kh\u00f3a v\u00e0 token \u1edf d\u1ea1ng ch\u1eef th\u01b0\u1eddng. Ch\u1ec9 d\u00f9ng khi chuy\u1ec3n sang m\u00e1y c\u00f3 kh\u00f3a m\u00e3 h\u00f3a kh\u00e1c, v\u00e0 x\u00f3a file ngay sau khi kh\u00f4i ph\u1ee5c.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t,\t\t\t\t{\n\t\t\t\t\"@type\": \"Question\",\n\t\t\t\t\"name\": \"n8n Cloud c\u00f3 c\u1ea7n t\u1ef1 backup kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>n8n Cloud kh\u00f4ng c\u00f3 CLI hay volume \u0111\u1ec3 ch\u00e9p. B\u1ea1n c\u00f3 th\u1ec3 export t\u1eebng workflow tr\u00ean giao di\u1ec7n ho\u1eb7c d\u00f9ng workflow g\u1ecdi n8n API \u1edf g\u00f3i tr\u1ea3 ph\u00ed; credential ph\u1ea3i ghi l\u1ea1i theo c\u00e1ch ri\u00eang.<\/p>\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t]\n\t}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>Backup n8n \u0111\u1ea7y \u0111\u1ee7 g\u1ed3m 3 ph\u1ea7n: workflow, credential v\u00e0 kh\u00f3a m\u00e3 h\u00f3a N8N_ENCRYPTION_KEY trong th\u01b0 m\u1ee5c .n8n. Tr\u00ean b\u1ea3n t\u1ef1 host, c\u00e1ch g\u1ecdn nh\u1ea5t l\u00e0 ch\u1ea1y n8n export:workflow &#8211;backup v\u00e0 n8n export:credentials &#8211;backup, r\u1ed3i ch\u00e9p k\u1ebft qu\u1ea3 c\u00f9ng kh\u00f3a ra ngo\u00e0i m\u00e1y ch\u1ee7. Kh\u00f4ng v\u00e0o \u0111\u01b0\u1ee3c m\u00e1y ch\u1ee7 th\u00ec d\u00f9ng workflow g\u1ecdi n8n API [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":116470,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7397],"tags":[7343],"class_list":["post-116442","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-n8n","tag-n8n"],"_links":{"self":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/116442","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/users\/23"}],"replies":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/comments?post=116442"}],"version-history":[{"count":12,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/116442\/revisions"}],"predecessor-version":[{"id":131867,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/116442\/revisions\/131867"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/116470"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=116442"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=116442"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=116442"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}