{"id":130649,"date":"2026-10-13T19:23:32","date_gmt":"2026-10-13T12:23:32","guid":{"rendered":"https:\/\/tino.vn\/blog\/?p=130649"},"modified":"2026-10-13T19:23:57","modified_gmt":"2026-10-13T12:23:57","slug":"doi-database-n8n-tu-sqlite-sang-postgresql","status":"publish","type":"post","link":"https:\/\/tino.vn\/blog\/doi-database-n8n-tu-sqlite-sang-postgresql\/","title":{"rendered":"H\u01b0\u1edbng d\u1eabn \u0111\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL kh\u00f4ng m\u1ea5t workflow"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>\u0110\u1ec3 \u0111\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL, b\u1ea1n c\u1ea7n sao l\u01b0u d\u1eef li\u1ec7u hi\u1ec7n t\u1ea1i, c\u1ea5u h\u00ecnh PostgreSQL trong Docker Compose, sau \u0111\u00f3 chuy\u1ec3n workflow v\u00e0 credential sang database m\u1edbi. Qu\u00e1 tr\u00ecnh n\u00e0y gi\u00fap n8n s\u1eed d\u1ee5ng PostgreSQL thay cho SQLite m\u00e0 kh\u00f4ng c\u1ea7n x\u00e2y d\u1ef1ng l\u1ea1i to\u00e0n b\u1ed9 quy tr\u00ecnh t\u1ef1 \u0111\u1ed9ng h\u00f3a. C\u00f9ng Tino theo d\u00f5i b\u00e0i vi\u1ebft d\u01b0\u1edbi \u0111\u00e2y nh\u00e9!<\/strong><\/p>\n\n\n\n<h2 id=\"T\u1ea1i_sao_n\u00ean_chuy\u1ec3n_database_n8n_t\u1eeb_SQLite_sang_PostgreSQL?\"><strong>T\u1ea1i sao n\u00ean chuy\u1ec3n database n8n t\u1eeb SQLite sang PostgreSQL?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><a href=\"https:\/\/www.postgresql.org\/\" target=\"_blank\" data-type=\"link\" data-id=\"https:\/\/www.postgresql.org\/\" rel=\"noreferrer noopener nofollow\">PostgreSQL<\/a> ph\u00f9 h\u1ee3p h\u01a1n khi tri\u1ec3n khai n8n l\u00e2u d\u00e0i tr\u00ean VPS<\/strong>, \u0111\u1eb7c bi\u1ec7t v\u1edbi h\u1ec7 th\u1ed1ng c\u00f3 nhi\u1ec1u workflow ho\u1ea1t \u0111\u1ed9ng th\u01b0\u1eddng xuy\u00ean ho\u1eb7c c\u1ea7n m\u1edf r\u1ed9ng kh\u1ea3 n\u0103ng x\u1eed l\u00fd.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Theo m\u1eb7c \u0111\u1ecbnh,<a href=\"https:\/\/tino.vn\/blog\/uu-nhuoc-diem-cua-self-hosted-n8n\/\" target=\"_blank\" data-type=\"post\" data-id=\"119737\" rel=\"noreferrer noopener\"> n8n self-hosted<\/a> s\u1eed d\u1ee5ng SQLite \u0111\u1ec3 l\u01b0u tr\u1eef workflow, th\u00f4ng tin \u0111\u0103ng nh\u1eadp \u0111\u00e3 m\u00e3 h\u00f3a v\u00e0 l\u1ecbch s\u1eed th\u1ef1c thi. PostgreSQL l\u00e0 l\u1ef1a ch\u1ecdn thay th\u1ebf \u0111\u01b0\u1ee3c n8n h\u1ed7 tr\u1ee3 ch\u00ednh th\u1ee9c.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-1.png\" alt=\"T\u1ea1i sao n\u00ean chuy\u1ec3n database n8n t\u1eeb SQLite sang PostgreSQL?\" class=\"wp-image-130658\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-1.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-1-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>T\u1ea1i sao n\u00ean chuy\u1ec3n database n8n t\u1eeb SQLite sang PostgreSQL?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 m\u1ed9t s\u1ed1 kh\u00e1c bi\u1ec7t:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>Ti\u00eau ch\u00ed<\/th><th>SQLite<\/th><th>PostgreSQL<\/th><\/tr><tr><td>C\u00e1ch l\u01b0u tr\u1eef<\/td><td>Database d\u1ea1ng t\u1ec7p<\/td><td>H\u1ec7 qu\u1ea3n tr\u1ecb database ri\u00eang<\/td><\/tr><tr><td>C\u00e0i \u0111\u1eb7t<\/td><td>\u0110\u01a1n gi\u1ea3n, c\u00f3 s\u1eb5n<\/td><td>C\u1ea7n c\u1ea5u h\u00ecnh b\u1ed5 sung<\/td><\/tr><tr><td>X\u1eed l\u00fd truy c\u1eadp \u0111\u1ed3ng th\u1eddi<\/td><td>H\u1ea1n ch\u1ebf h\u01a1n<\/td><td>Ph\u00f9 h\u1ee3p h\u01a1n v\u1edbi nhi\u1ec1u thao t\u00e1c \u0111\u1ed3ng th\u1eddi<\/td><\/tr><tr><td>Qu\u1ea3n tr\u1ecb<\/td><td>\u00cdt th\u00e0nh ph\u1ea7n<\/td><td>C\u00f3 c\u00f4ng c\u1ee5 qu\u1ea3n tr\u1ecb chuy\u00ean d\u1ee5ng<\/td><\/tr><tr><td>Sao l\u01b0u<\/td><td>Sao l\u01b0u t\u1ec7p ho\u1eb7c d\u00f9ng c\u00f4ng c\u1ee5 SQLite<\/td><td>H\u1ed7 tr\u1ee3 c\u00e1c c\u00f4ng c\u1ee5 nh\u01b0 pg_dump<\/td><\/tr><tr><td>Tr\u01b0\u1eddng h\u1ee3p ph\u00f9 h\u1ee3p<\/td><td>Th\u1eed nghi\u1ec7m, h\u1ec7 th\u1ed1ng nh\u1ecf<\/td><td>H\u1ec7 th\u1ed1ng s\u1ea3n xu\u1ea5t, s\u1eed d\u1ee5ng l\u00e2u d\u00e0i<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Khi n\u00e0o n\u00ean chuy\u1ec3n sang PostgreSQL?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VPS ch\u1ea1y nhi\u1ec1u workflow n8n th\u01b0\u1eddng xuy\u00ean.<\/li>\n\n\n\n<li>C\u00f3 nhi\u1ec1u ng\u01b0\u1eddi c\u00f9ng s\u1eed d\u1ee5ng n8n.<\/li>\n\n\n\n<li>C\u1ea7n qu\u1ea3n l\u00fd, sao l\u01b0u v\u00e0 kh\u00f4i ph\u1ee5c database chuy\u00ean nghi\u1ec7p h\u01a1n.<\/li>\n\n\n\n<li>C\u00f3 k\u1ebf ho\u1ea1ch m\u1edf r\u1ed9ng n8n ho\u1eb7c tri\u1ec3n khai queue mode.<\/li>\n\n\n\n<li>Mu\u1ed1n s\u1eed d\u1ee5ng PostgreSQL l\u00e0m database l\u00e2u d\u00e0i cho h\u1ec7 th\u1ed1ng.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Tuy nhi\u00ean, PostgreSQL kh\u00f4ng m\u1eb7c \u0111\u1ecbnh gi\u00fap m\u1ecdi workflow ch\u1ea1y nhanh h\u01a1n. Hi\u1ec7u qu\u1ea3 th\u1ef1c t\u1ebf c\u00f2n ph\u1ee5 thu\u1ed9c v\u00e0o t\u00e0i nguy\u00ean VPS, s\u1ed1 l\u01b0\u1ee3ng t\u00e1c v\u1ee5, c\u00e1ch thi\u1ebft k\u1ebf workflow v\u00e0 c\u1ea5u h\u00ecnh h\u1ec7 th\u1ed1ng.<\/p>\n\n\n\n<h2 id=\"C\u1ea7n_chu\u1ea9n_b\u1ecb_g\u00ec_tr\u01b0\u1edbc_khi_chuy\u1ec3n_database_n8n?\"><strong>C\u1ea7n chu\u1ea9n b\u1ecb g\u00ec tr\u01b0\u1edbc khi chuy\u1ec3n database n8n?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n, b\u1ea1n c\u1ea7n chu\u1ea9n b\u1ecb:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>VPS Linux \u0111\u00e3 c\u00e0i Docker v\u00e0 Docker Compose.<\/li>\n\n\n\n<li>n8n \u0111ang ho\u1ea1t \u0111\u1ed9ng v\u1edbi database SQLite.<\/li>\n\n\n\n<li>Quy\u1ec1n SSH \u0111\u1ec3 truy c\u1eadp v\u00e0 ch\u1ec9nh s\u1eeda c\u1ea5u h\u00ecnh VPS.<\/li>\n\n\n\n<li>Quy\u1ec1n truy c\u1eadp t\u1ec7p Docker Compose hi\u1ec7n t\u1ea1i.<\/li>\n\n\n\n<li>Dung l\u01b0\u1ee3ng tr\u1ed1ng \u0111\u1ec3 l\u01b0u b\u1ea3n sao l\u01b0u v\u00e0 database PostgreSQL.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>L\u01b0u \u00fd:<\/strong> H\u01b0\u1edbng d\u1eabn d\u01b0\u1edbi \u0111\u00e2y \u00e1p d\u1ee5ng cho n8n self-hosted tri\u1ec3n khai b\u1eb1ng Docker Compose, v\u1edbi service mang t\u00ean n8n v\u00e0 th\u01b0 m\u1ee5c d\u1eef li\u1ec7u \u0111\u01b0\u1ee3c g\u1eafn t\u1ea1i \/home\/node\/.n8n.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu \u0111ang s\u1eed d\u1ee5ng Docker \u0111\u1ed9c l\u1eadp, npm ho\u1eb7c m\u1ed9t h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd container kh\u00e1c, c\u1ea7n \u0111i\u1ec1u ch\u1ec9nh c\u00e2u l\u1ec7nh v\u00e0 c\u00e1ch tri\u1ec3n khai cho ph\u00f9 h\u1ee3p.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-2.png\" alt=\"C\u1ea7n chu\u1ea9n b\u1ecb g\u00ec tr\u01b0\u1edbc khi chuy\u1ec3n database n8n?\" class=\"wp-image-130659\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-2.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-2-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u1ea7n chu\u1ea9n b\u1ecb g\u00ec tr\u01b0\u1edbc khi chuy\u1ec3n database n8n?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"Nh\u1eefng_d\u1eef_li\u1ec7u_n\u00e0o_s\u1ebd_\u0111\u01b0\u1ee3c_chuy\u1ec3n?\"><strong>Nh\u1eefng d\u1eef li\u1ec7u n\u00e0o s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ph\u01b0\u01a1ng ph\u00e1p trong b\u00e0i s\u1eed d\u1ee5ng CLI c\u1ee7a n8n \u0111\u1ec3 xu\u1ea5t v\u00e0 nh\u1eadp workflow, credential.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><th>D\u1eef li\u1ec7u<\/th><th>K\u1ebft qu\u1ea3<\/th><\/tr><tr><td>Workflow<\/td><td>C\u00f3 th\u1ec3 chuy\u1ec3n<\/td><\/tr><tr><td>Credential \u0111\u00e3 m\u00e3 h\u00f3a<\/td><td>C\u00f3 th\u1ec3 chuy\u1ec3n n\u1ebfu gi\u1eef \u0111\u00fang encryption key<\/td><\/tr><tr><td>T\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng v\u00e0 ph\u00e2n quy\u1ec1n<\/td><td>Kh\u00f4ng \u0111\u01b0\u1ee3c chuy\u1ec3n<\/td><\/tr><tr><td>L\u1ecbch s\u1eed th\u1ef1c thi<\/td><td>Kh\u00f4ng \u0111\u01b0\u1ee3c chuy\u1ec3n<\/td><\/tr><tr><td>Variables<\/td><td>Kh\u00f4ng \u0111\u01b0\u1ee3c chuy\u1ec3n<\/td><\/tr><tr><td>Thi\u1ebft l\u1eadp c\u1ea5p h\u1ec7 th\u1ed1ng<\/td><td>C\u1ea7n c\u1ea5u h\u00ecnh l\u1ea1i<\/td><\/tr><tr><td>Custom nodes v\u00e0 d\u1eef li\u1ec7u l\u01b0u b\u00ean ngo\u00e0i<\/td><td>C\u1ea7n ki\u1ec3m tra, sao l\u01b0u ri\u00eang<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ec v\u1eady, h\u01b0\u1edbng d\u1eabn ph\u00f9 h\u1ee3p nh\u1ea5t v\u1edbi h\u1ec7 th\u1ed1ng nh\u1ecf, \u00edt ng\u01b0\u1eddi d\u00f9ng v\u00e0 \u01b0u ti\u00ean gi\u1eef l\u1ea1i c\u00e1c workflow \u0111ang s\u1eed d\u1ee5ng.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu c\u1ea7n b\u1ea3o to\u00e0n to\u00e0n b\u1ed9 t\u00e0i kho\u1ea3n, d\u1ef1 \u00e1n, ph\u00e2n quy\u1ec1n v\u00e0 l\u1ecbch s\u1eed ho\u1ea1t \u0111\u1ed9ng, c\u1ea7n \u0111\u00e1nh gi\u00e1 ph\u01b0\u01a1ng \u00e1n di chuy\u1ec3n to\u00e0n b\u1ed9 database thay v\u00ec ch\u1ec9 xu\u1ea5t workflow v\u00e0 credential.<\/p>\n\n\n\n<h2 id=\"H\u01b0\u1edbng_d\u1eabn_\u0111\u1ed5i_database_n8n_t\u1eeb_SQLite_sang_PostgreSQL\"><strong>H\u01b0\u1edbng d\u1eabn \u0111\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00e1c b\u01b0\u1edbc sau \u0111\u01b0\u1ee3c th\u1ef1c hi\u1ec7n qua Terminal SSH tr\u00ean VPS Linux. V\u00ed d\u1ee5 s\u1eed d\u1ee5ng Docker Compose v\u00e0 PostgreSQL 17.<\/p>\n\n\n\n<h3 id=\"B\u01b0\u1edbc_1:_Ki\u1ec3m_tra_n8n_\u0111ang_ch\u1ea1y_tr\u00ean_VPS\"><strong>B\u01b0\u1edbc 1: Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1ea7u ti\u00ean, SSH v\u00e0o VPS b\u1eb1ng Xshell ho\u1eb7c ph\u1ea7n m\u1ec1m SSH \u0111ang s\u1eed d\u1ee5ng. Ti\u1ebfp theo, di chuy\u1ec3n \u0111\u1ebfn th\u01b0 m\u1ee5c ch\u1ee9a t\u1ec7p <strong>compose.yaml<\/strong> ho\u1eb7c <strong>docker-compose.yml<\/strong> c\u1ee7a n8n (t\u00f9y VPS c\u1ee7a b\u1ea1n). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y l\u1ec7nh:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker compose ls<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Trong v\u00ed d\u1ee5 n\u00e0y, t\u1ec7p Docker Compose n\u1eb1m t\u1ea1i:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/opt\/n8n\/docker-compose.yml<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi t\u00ecm \u0111\u01b0\u1ee3c \u0111\u01b0\u1eddng d\u1eabn, chuy\u1ec3n \u0111\u1ebfn th\u01b0 m\u1ee5c t\u01b0\u01a1ng \u1ee9ng. V\u00ed d\u1ee5:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/n8n<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"773\" height=\"295\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_1-6.png\" alt=\"Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS\" class=\"wp-image-130651\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_1-6.png 773w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_1-6-300x114.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_1-6-768x293.png 768w\" sizes=\"(max-width: 773px) 100vw, 773px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Sau \u0111\u00f3, ki\u1ec3m tra c\u00e1c container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose ps<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"189\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6-1024x189.png\" alt=\"Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS\" class=\"wp-image-130652\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6-1024x189.png 1024w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6-300x55.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6-768x142.png 768w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6-1536x283.png 1536w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_2-6.png 1725w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu n8n \u0111ang ho\u1ea1t \u0111\u1ed9ng, b\u1ea1n s\u1ebd th\u1ea5y service n8n trong danh s\u00e1ch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ti\u1ebfp t\u1ee5c ki\u1ec3m tra phi\u00ean b\u1ea3n n8n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec -T n8n n8n --version<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1edf t\u1ec7p Docker Compose hi\u1ec7n t\u1ea1i:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">sudo nano docker-compose.yml<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">T\u1ea1i \u0111\u00e2y ki\u1ec3m tra ph\u1ea7n volumes c\u1ee7a service n8n. V\u00ed d\u1ee5:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>volumes:\n\n&nbsp;&nbsp;- n8n_data:\/home\/node\/.n8n<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"866\" height=\"336\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_3-5.png\" alt=\"Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS\" class=\"wp-image-130653\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_3-5.png 866w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_3-5-300x116.png 300w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_3-5-768x298.png 768w\" sizes=\"(max-width: 866px) 100vw, 866px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra n8n \u0111ang ch\u1ea1y tr\u00ean VPS<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Th\u00f4ng th\u01b0\u1eddng, SQLite \u0111\u01b0\u1ee3c l\u01b0u t\u1ea1i:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/home\/node\/.n8n\/database.sqlite<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u00e2y l\u00e0 th\u01b0 m\u1ee5c c\u1ea7n gi\u1eef nguy\u00ean trong su\u1ed1t qu\u00e1 tr\u00ecnh chuy\u1ec3n database, v\u00ec c\u00f2n ch\u1ee9a kh\u00f3a m\u00e3 h\u00f3a credential v\u00e0 c\u00e1c d\u1eef li\u1ec7u quan tr\u1ecdng kh\u00e1c.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi ki\u1ec3m tra xong, nh\u1ea5n <strong>Ctrl + X<\/strong> \u0111\u1ec3 tho\u00e1t.<\/p>\n\n\n\n<h3 id=\"B\u01b0\u1edbc_2:_Sao_l\u01b0u_v\u00e0_xu\u1ea5t_workflow,_credential\"><strong>B\u01b0\u1edbc 2: Sao l\u01b0u v\u00e0 xu\u1ea5t workflow, credential<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tr\u01b0\u1edbc khi thay \u0111\u1ed5i database, h\u00e3y d\u1eebng n8n v\u00e0 t\u1ea1o b\u1ea3n sao l\u01b0u d\u1eef li\u1ec7u hi\u1ec7n t\u1ea1i.<\/strong> \u0110\u1ed1i v\u1edbi h\u1ec7 th\u1ed1ng \u0111ang x\u1eed l\u00fd t\u00e1c v\u1ee5 quan tr\u1ecdng, h\u00e3y ch\u1edd c\u00e1c workflow c\u1ea7n thi\u1ebft ho\u00e0n t\u1ea5t v\u00e0 l\u00ean l\u1ecbch b\u1ea3o tr\u00ec tr\u01b0\u1edbc khi d\u1eebng.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose stop n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">T\u1ea1o th\u01b0 m\u1ee5c l\u01b0u b\u1ea3n sao tr\u00ean VPS:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p .\/backup-n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Sao ch\u00e9p th\u01b0 m\u1ee5c d\u1eef li\u1ec7u n8n t\u1eeb container:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose cp n8n:\/home\/node\/.n8n .\/backup-n8n\/<\/code><\/pre>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"560\" height=\"122\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_5-6.png\" alt=\"Sao l\u01b0u v\u00e0 xu\u1ea5t workflow, credential\" class=\"wp-image-130654\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_5-6.png 560w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_5-6-300x65.png 300w\" sizes=\"(max-width: 560px) 100vw, 560px\" \/><figcaption class=\"wp-element-caption\"><strong>Sao l\u01b0u v\u00e0 xu\u1ea5t workflow, credential<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Ki\u1ec3m tra th\u01b0 m\u1ee5c <strong>backup-n8n\/.n8n<\/strong> \u0111\u1ec3 x\u00e1c nh\u1eadn \u0111\u00e3 c\u00f3 b\u1ea3n sao database v\u00e0 t\u1ec7p c\u1ea5u h\u00ecnh. \u0110\u1ed3ng th\u1eddi, sao l\u01b0u t\u1ec7p Docker Compose, <strong>.env<\/strong> v\u00e0 c\u00e1c th\u01b0 m\u1ee5c d\u1eef li\u1ec7u ngo\u00e0i n\u1ebfu \u0111ang s\u1eed d\u1ee5ng.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ti\u1ebfp theo, xu\u1ea5t to\u00e0n b\u1ed9 workflow b\u1eb1ng CLI:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose run --rm --no-deps n8n export:workflow --backup --output=\/home\/node\/.n8n\/migration\/workflows\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Xu\u1ea5t credential:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose run --rm --no-deps n8n export:credentials --backup --output=\/home\/node\/.n8n\/migration\/credentials\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00e1c t\u1ec7p JSON \u0111\u01b0\u1ee3c l\u01b0u trong th\u01b0 m\u1ee5c migration thu\u1ed9c volume d\u1eef li\u1ec7u c\u1ee7a n8n \u0111\u1ec3 c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng l\u1ea1i sau khi \u0111\u1ed5i database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Quan tr\u1ecdng:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Hai l\u1ec7nh ph\u1ea3i th\u1ef1c hi\u1ec7n th\u00e0nh c\u00f4ng tr\u01b0\u1edbc khi chuy\u1ec3n sang b\u01b0\u1edbc ti\u1ebfp theo.<\/li>\n\n\n\n<li>Gi\u1eef nguy\u00ean kh\u00f3a m\u00e3 h\u00f3a N8N_ENCRYPTION_KEY ho\u1eb7c kh\u00f3a trong t\u1ec7p c\u1ea5u h\u00ecnh n8n hi\u1ec7n t\u1ea1i.<\/li>\n\n\n\n<li>Kh\u00f4ng x\u00f3a volume n8n_data.<\/li>\n\n\n\n<li>N\u00ean sao ch\u00e9p b\u1ea3n backup ra kh\u1ecfi VPS \u0111\u1ec3 \u0111\u1ec1 ph\u00f2ng s\u1ef1 c\u1ed1 m\u00e1y ch\u1ee7.<\/li>\n<\/ul>\n\n\n\n<h3 id=\"B\u01b0\u1edbc_3:_C\u1ea5u_h\u00ecnh_PostgreSQL_trong_Docker_Compose\"><strong>B\u01b0\u1edbc 3: C\u1ea5u h\u00ecnh PostgreSQL trong Docker Compose<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi sao l\u01b0u, b\u1ea1n c\u1ea7n b\u1ed5 sung PostgreSQL v\u00e0o h\u1ec7 th\u1ed1ng Docker Compose hi\u1ec7n t\u1ea1i.<\/p>\n\n\n\n<h4 id=\"Th\u00eam_th\u00f4ng_tin_PostgreSQL_v\u00e0o_.env\"><strong>Th\u00eam th\u00f4ng tin PostgreSQL v\u00e0o<\/strong> <strong>.env<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1edf t\u1ec7p .env trong th\u01b0 m\u1ee5c Docker Compose v\u00e0 th\u00eam:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>POSTGRES_USER=n8n\n\nPOSTGRES_DB=n8n\n\nPOSTGRES_PASSWORD=THAY_BANG_MAT_KHAU_MANH<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Thay gi\u00e1 tr\u1ecb <strong>POSTGRES_PASSWORD<\/strong> b\u1eb1ng m\u1eadt kh\u1ea9u m\u1ea1nh do b\u1ea1n t\u1ef1 t\u1ea1o. Kh\u00f4ng s\u1eed d\u1ee5ng nguy\u00ean m\u1eadt kh\u1ea9u m\u1eabu khi tri\u1ec3n khai th\u1ef1c t\u1ebf.<\/p>\n\n\n\n<h4 id=\"Th\u00eam_service_PostgreSQL\"><strong>Th\u00eam service PostgreSQL<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">M\u1edf t\u1ec7p compose.yaml ho\u1eb7c docker-compose.yml, sau \u0111\u00f3 b\u1ed5 sung service sau v\u00e0o ph\u1ea7n services:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>postgres:\n\n&nbsp;&nbsp;&nbsp;&nbsp;image: postgres:17\n\n&nbsp;&nbsp;&nbsp;&nbsp;restart: unless-stopped\n\n&nbsp;&nbsp;&nbsp;&nbsp;environment:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POSTGRES_USER: ${POSTGRES_USER}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;POSTGRES_DB: ${POSTGRES_DB}\n\n&nbsp;&nbsp;&nbsp;&nbsp;volumes:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;- postgres_data:\/var\/lib\/postgresql\/data\n\n&nbsp;&nbsp;&nbsp;&nbsp;healthcheck:\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;test: &#091;\"CMD-SHELL\", \"pg_isready -U n8n -d n8n\"]\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interval: 5s\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;timeout: 5s\n\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retries: 10<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede cu\u1ed1i t\u1ec7p Docker Compose, th\u00eam volume m\u1edbi v\u00e0o ph\u1ea7n volumes hi\u1ec7n c\u00f3:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>volumes:\n\n&nbsp;&nbsp;n8n_data:\n\n&nbsp;&nbsp;postgres_data:<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u00e2y l\u00e0 v\u00ed d\u1ee5 d\u00e0nh cho h\u1ec7 th\u1ed1ng \u0111ang d\u00f9ng named volume n8n_data. N\u1ebfu t\u1ec7p hi\u1ec7n t\u1ea1i \u0111\u00e3 khai b\u00e1o c\u00e1c volume kh\u00e1c, h\u00e3y gi\u1eef nguy\u00ean v\u00e0 ch\u1ec9 b\u1ed5 sung postgres_data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PostgreSQL s\u1eed d\u1ee5ng volume ri\u00eang \u0111\u1ec3 d\u1eef li\u1ec7u kh\u00f4ng b\u1ecb m\u1ea5t khi container \u0111\u01b0\u1ee3c t\u1ea1o l\u1ea1i.<\/p>\n\n\n\n<h4 id=\"C\u1eadp_nh\u1eadt_c\u1ea5u_h\u00ecnh_database_cho_n8n\"><strong>C\u1eadp nh\u1eadt c\u1ea5u h\u00ecnh database cho n8n<\/strong><\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Trong service n8n, b\u1ed5 sung c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>environment:\n\n&nbsp;&nbsp;DB_TYPE: postgresdb\n\n&nbsp;&nbsp;DB_POSTGRESDB_HOST: postgres\n\n&nbsp;&nbsp;DB_POSTGRESDB_PORT: \"5432\"\n\n&nbsp;&nbsp;DB_POSTGRESDB_DATABASE: ${POSTGRES_DB}\n\n&nbsp;&nbsp;DB_POSTGRESDB_USER: ${POSTGRES_USER}\n\n&nbsp;&nbsp;DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Gi\u1eef l\u1ea1i c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng c\u00f3 s\u1eb5n nh\u01b0 c\u1ea5u h\u00ecnh t\u00ean mi\u1ec1n, webhook, m\u00fai gi\u1edd, encryption key v\u00e0 nh\u1eefng thi\u1ebft l\u1eadp li\u00ean quan kh\u00e1c. N\u1ebfu service \u0111ang s\u1eed d\u1ee5ng d\u1ea1ng danh s\u00e1ch environment, h\u00e3y th\u00eam c\u00e1c bi\u1ebfn theo c\u00f9ng \u0111\u1ecbnh d\u1ea1ng.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"650\" height=\"297\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_7-5.png\" alt=\"C\u1eadp nh\u1eadt c\u1ea5u h\u00ecnh database cho n8n\" class=\"wp-image-130656\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_7-5.png 650w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_7-5-300x137.png 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u1eadp nh\u1eadt c\u1ea5u h\u00ecnh database cho n8n<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Ti\u1ebfp t\u1ee5c b\u1ed5 sung PostgreSQL v\u00e0o ph\u1ea7n <strong>depends_on<\/strong> <strong><\/strong>c\u1ee7a service n8n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>depends_on:\n\n&nbsp;&nbsp;postgres:\n\n&nbsp;&nbsp;&nbsp;&nbsp;condition: service_healthy<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu \u0111\u00e3 c\u00f3 depends_on, ch\u1ec9 b\u1ed5 sung PostgreSQL v\u00e0 gi\u1eef c\u00e1c service ph\u1ee5 thu\u1ed9c tr\u01b0\u1edbc \u0111\u00f3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>L\u01b0u \u00fd:<\/strong> Nh\u1eefng \u0111o\u1ea1n YAML tr\u00ean l\u00e0 c\u00e1c ph\u1ea7n c\u1ea7n th\u00eam v\u00e0o c\u1ea5u h\u00ecnh hi\u1ec7n t\u1ea1i, kh\u00f4ng ph\u1ea3i m\u1ed9t t\u1ec7p Docker Compose ho\u00e0n ch\u1ec9nh \u0111\u1ec3 thay th\u1ebf to\u00e0n b\u1ed9 t\u1ec7p c\u0169. \u0110\u1eb7c bi\u1ec7t, kh\u00f4ng thay \u0111\u1ed5i image n8n, \u0111\u01b0\u1eddng d\u1eabn volume c\u0169 ho\u1eb7c t\u00ean Docker Compose project trong c\u00f9ng l\u1ea7n chuy\u1ec3n database.<\/p>\n\n\n\n<h3 id=\"B\u01b0\u1edbc_4:_Kh\u1edfi_\u0111\u1ed9ng_n8n_v\u1edbi_PostgreSQL\"><strong>B\u01b0\u1edbc 4: Kh\u1edfi \u0111\u1ed9ng n8n v\u1edbi PostgreSQL<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi ho\u00e0n t\u1ea5t c\u1ea5u h\u00ecnh, ki\u1ec3m tra c\u00fa ph\u00e1p Docker Compose:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose config -q<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu l\u1ec7nh kh\u00f4ng b\u00e1o l\u1ed7i, kh\u1edfi \u0111\u1ed9ng PostgreSQL v\u00e0 n8n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose up -d postgres n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ki\u1ec3m tra tr\u1ea1ng th\u00e1i:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose ps<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Xem log n8n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose logs --tail=50 n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu c\u1ea5u h\u00ecnh ch\u00ednh x\u00e1c, n8n s\u1ebd k\u1ebft n\u1ed1i PostgreSQL v\u00e0 t\u1ea1o c\u00e1c b\u1ea3ng c\u1ea7n thi\u1ebft trong database m\u1edbi.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ec PostgreSQL ch\u01b0a ch\u1ee9a t\u00e0i kho\u1ea3n ng\u01b0\u1eddi d\u00f9ng t\u1eeb SQLite, n8n c\u00f3 th\u1ec3 hi\u1ec3n th\u1ecb m\u00e0n h\u00ecnh thi\u1ebft l\u1eadp t\u00e0i kho\u1ea3n Owner.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">H\u00e3y m\u1edf giao di\u1ec7n web n8n v\u00e0 ho\u00e0n t\u1ea5t b\u01b0\u1edbc t\u1ea1o Owner tr\u01b0\u1edbc khi nh\u1eadp d\u1eef li\u1ec7u.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>L\u01b0u \u00fd:<\/strong> Nh\u1eefng workflow c\u0169 ch\u01b0a xu\u1ea5t hi\u1ec7n \u1edf th\u1eddi \u0111i\u1ec3m n\u00e0y l\u00e0 \u0111i\u1ec1u b\u00ecnh th\u01b0\u1eddng. D\u1eef li\u1ec7u s\u1ebd \u0111\u01b0\u1ee3c nh\u1eadp \u1edf b\u01b0\u1edbc ti\u1ebfp theo.<\/p>\n\n\n\n<h3 id=\"B\u01b0\u1edbc_5:_Nh\u1eadp_l\u1ea1i_workflow_v\u00e0_credential\"><strong>B\u01b0\u1edbc 5: Nh\u1eadp l\u1ea1i workflow v\u00e0 credential<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi t\u1ea1o t\u00e0i kho\u1ea3n Owner, tr\u1edf l\u1ea1i Terminal SSH v\u00e0 nh\u1eadp workflow \u0111\u00e3 sao l\u01b0u:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec -T n8n n8n import:workflow --separate --input=\/home\/node\/.n8n\/migration\/workflows\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Ti\u1ebfp t\u1ee5c nh\u1eadp credential:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec -T n8n n8n import:credentials --separate --input=\/home\/node\/.n8n\/migration\/credentials\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu c\u1ea3 hai l\u1ec7nh th\u1ef1c hi\u1ec7n th\u00e0nh c\u00f4ng, kh\u1edfi \u0111\u1ed9ng l\u1ea1i n8n:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose restart n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Truy c\u1eadp giao di\u1ec7n web v\u00e0 ki\u1ec3m tra c\u00e1c workflow \u0111\u00e3 \u0111\u01b0\u1ee3c chuy\u1ec3n sang PostgreSQL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Sau \u0111\u00f3:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>M\u1edf m\u1ed9t workflow quan tr\u1ecdng.<\/li>\n\n\n\n<li>Ki\u1ec3m tra c\u00e1c node v\u00e0 credential \u0111ang s\u1eed d\u1ee5ng.<\/li>\n\n\n\n<li>Ch\u1ea1y th\u1eed workflow b\u1eb1ng thao t\u00e1c th\u1ee7 c\u00f4ng.<\/li>\n\n\n\n<li>Ki\u1ec3m tra k\u1ebft qu\u1ea3 trong ph\u1ea7n Executions.<\/li>\n\n\n\n<li>Publish l\u1ea1i c\u00e1c workflow c\u1ea7n k\u00edch ho\u1ea1t.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u1ede n8n 2.x, c\u00e1c workflow nh\u1eadp b\u1eb1ng Server CLI m\u1eb7c \u0111\u1ecbnh kh\u00f4ng \u0111\u01b0\u1ee3c k\u00edch ho\u1ea1t. V\u00ec v\u1eady, h\u00e3y ki\u1ec3m tra tr\u1ea1ng th\u00e1i Publish tr\u01b0\u1edbc khi \u0111\u01b0a h\u1ec7 th\u1ed1ng tr\u1edf l\u1ea1i ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu h\u1ec7 th\u1ed1ng c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi d\u00f9ng ho\u1eb7c project, c\u1ea7n ki\u1ec3m tra quy\u1ec1n s\u1edf h\u1eefu v\u00e0 s\u1eed d\u1ee5ng t\u00f9y ch\u1ecdn &#8211;userId ho\u1eb7c &#8211;projectId ph\u00f9 h\u1ee3p khi nh\u1eadp d\u1eef li\u1ec7u.<\/p>\n\n\n\n<h2 id=\"C\u00e1ch_ki\u1ec3m_tra_n8n_\u0111\u00e3_chuy\u1ec3n_sang_PostgreSQL_th\u00e0nh_c\u00f4ng\"><strong>C\u00e1ch ki\u1ec3m tra n8n \u0111\u00e3 chuy\u1ec3n sang PostgreSQL th\u00e0nh c\u00f4ng<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Sau khi ho\u00e0n t\u1ea5t, b\u1ea1n c\u00f3 th\u1ec3 x\u00e1c minh b\u1eb1ng hai c\u00e1ch.<\/p>\n\n\n\n<h3 id=\"C\u00e1ch_1_\u2013_Ki\u1ec3m_tra_k\u1ebft_n\u1ed1i_PostgreSQL\"><strong>C\u00e1ch 1 \u2013 Ki\u1ec3m tra k\u1ebft n\u1ed1i PostgreSQL<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ch\u1ea1y l\u1ec7nh:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec -T postgres pg_isready -U n8n -d n8n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu PostgreSQL s\u1eb5n s\u00e0ng nh\u1eadn k\u1ebft n\u1ed1i, k\u1ebft qu\u1ea3 s\u1ebd th\u00f4ng b\u00e1o database \u0111ang ch\u1ea5p nh\u1eadn k\u1ebft n\u1ed1i.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"760\" height=\"244\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_6-6.png\" alt=\"Ki\u1ec3m tra k\u1ebft n\u1ed1i PostgreSQL\" class=\"wp-image-130655\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_6-6.png 760w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/Screenshot_6-6-300x96.png 300w\" sizes=\"(max-width: 760px) 100vw, 760px\" \/><figcaption class=\"wp-element-caption\"><strong>Ki\u1ec3m tra k\u1ebft n\u1ed1i PostgreSQL<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Ti\u1ebfp t\u1ee5c ki\u1ec3m tra danh s\u00e1ch b\u1ea3ng:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose exec -T postgres psql -U n8n -d n8n -c '\\dt'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu danh s\u00e1ch b\u1ea3ng \u0111\u01b0\u1ee3c hi\u1ec3n th\u1ecb, PostgreSQL \u0111\u00e3 \u0111\u01b0\u1ee3c kh\u1edfi t\u1ea1o. K\u1ebft h\u1ee3p ki\u1ec3m tra n\u00e0y v\u1edbi c\u1ea5u h\u00ecnh DB_TYPE=postgresdb c\u1ee7a service n8n \u0111\u1ec3 x\u00e1c nh\u1eadn \u1ee9ng d\u1ee5ng \u0111ang s\u1eed d\u1ee5ng \u0111\u00fang database.<\/p>\n\n\n\n<h3 id=\"C\u00e1ch_2_\u2013_Ki\u1ec3m_tra_tr\u1ef1c_ti\u1ebfp_tr\u00ean_n8n\"><strong>C\u00e1ch 2 \u2013 Ki\u1ec3m tra tr\u1ef1c ti\u1ebfp tr\u00ean n8n<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Truy c\u1eadp giao di\u1ec7n n8n.<\/li>\n\n\n\n<li>Ki\u1ec3m tra danh s\u00e1ch workflow v\u00e0 credential.<\/li>\n\n\n\n<li>M\u1edf m\u1ed9t workflow v\u00e0 ch\u1ea1y th\u1eed.<\/li>\n\n\n\n<li>X\u00e1c nh\u1eadn k\u1ebft qu\u1ea3 th\u1ef1c thi m\u1edbi \u0111\u01b0\u1ee3c l\u01b0u th\u00e0nh c\u00f4ng.<\/li>\n\n\n\n<li>Ki\u1ec3m tra c\u00e1c workflow c\u00f3 webhook ho\u1eb7c l\u1ecbch ch\u1ea1y t\u1ef1 \u0111\u1ed9ng.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>K\u1ebft qu\u1ea3 mong \u0111\u1ee3i:<\/strong> n8n s\u1eed d\u1ee5ng PostgreSQL, workflow v\u00e0 credential \u0111\u00e3 nh\u1eadp ho\u1ea1t \u0111\u1ed9ng b\u00ecnh th\u01b0\u1eddng, \u0111\u1ed3ng th\u1eddi kh\u00f4ng xu\u1ea5t hi\u1ec7n l\u1ed7i k\u1ebft n\u1ed1i ho\u1eb7c gi\u1ea3i m\u00e3 d\u1eef li\u1ec7u.<\/p>\n\n\n\n<h2 id=\"C\u00e1c_l\u1ed7i_th\u01b0\u1eddng_g\u1eb7p_v\u00e0_c\u00e1ch_kh\u1eafc_ph\u1ee5c\"><strong>C\u00e1c l\u1ed7i th\u01b0\u1eddng g\u1eb7p v\u00e0 c\u00e1ch kh\u1eafc ph\u1ee5c<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Trong qu\u00e1 tr\u00ecnh \u0111\u1ed5i database n8n, m\u1ed9t s\u1ed1 v\u1ea5n \u0111\u1ec1 c\u00f3 th\u1ec3 xu\u1ea5t hi\u1ec7n:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>L\u1ed7i<\/strong><\/td><td><strong>Nguy\u00ean nh\u00e2n v\u00e0 c\u00e1ch x\u1eed l\u00fd<\/strong><\/td><\/tr><tr><td>ECONNREFUSED<\/td><td>PostgreSQL ch\u01b0a s\u1eb5n s\u00e0ng ho\u1eb7c c\u1ea5u h\u00ecnh k\u1ebft n\u1ed1i kh\u00f4ng ch\u00ednh x\u00e1c. Ki\u1ec3m tra docker compose ps v\u00e0 log PostgreSQL.<\/td><\/tr><tr><td>ENOTFOUND postgres<\/td><td>T\u00ean service database ho\u1eb7c m\u1ea1ng Docker Compose kh\u00f4ng \u0111\u00fang. Ki\u1ec3m tra DB_POSTGRESDB_HOST.<\/td><\/tr><tr><td>password authentication failed<\/td><td>Sai th\u00f4ng tin \u0111\u0103ng nh\u1eadp PostgreSQL. \u0110\u1ed1i chi\u1ebfu .env v\u1edbi c\u1ea5u h\u00ecnh database th\u1ef1c t\u1ebf.<\/td><\/tr><tr><td>Kh\u00f4ng th\u1ea5y workflow c\u0169<\/td><td>Ch\u01b0a nh\u1eadp d\u1eef li\u1ec7u, nh\u1eadp sai v\u1ecb tr\u00ed ho\u1eb7c t\u00e0i kho\u1ea3n ch\u01b0a c\u00f3 quy\u1ec1n truy c\u1eadp. Ki\u1ec3m tra k\u1ebft qu\u1ea3 l\u1ec7nh import.<\/td><\/tr><tr><td>Credential kh\u00f4ng gi\u1ea3i m\u00e3 \u0111\u01b0\u1ee3c<\/td><td>Encryption key kh\u00e1c v\u1edbi h\u1ec7 th\u1ed1ng c\u0169. Kh\u00f4i ph\u1ee5c \u0111\u00fang kh\u00f3a m\u00e3 h\u00f3a \u0111\u00e3 s\u1eed d\u1ee5ng.<\/td><\/tr><tr><td>Workflow kh\u00f4ng t\u1ef1 ch\u1ea1y<\/td><td>Workflow ch\u01b0a Publish sau khi nh\u1eadp. Ki\u1ec3m tra tr\u1ea1ng th\u00e1i v\u00e0 k\u00edch ho\u1ea1t l\u1ea1i khi \u0111\u00e3 th\u1eed nghi\u1ec7m th\u00e0nh c\u00f4ng.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">N\u1ebfu PostgreSQL \u0111\u00e3 \u0111\u01b0\u1ee3c kh\u1edfi t\u1ea1o tr\u01b0\u1edbc \u0111\u00f3, thay \u0111\u1ed5i POSTGRES_PASSWORD trong .env kh\u00f4ng t\u1ef1 \u0111\u1ed9ng thay \u0111\u1ed5i m\u1eadt kh\u1ea9u b\u00ean trong database. Trong tr\u01b0\u1eddng h\u1ee3p n\u00e0y, c\u1ea7n c\u1eadp nh\u1eadt m\u1eadt kh\u1ea9u PostgreSQL \u0111\u00fang c\u00e1ch thay v\u00ec x\u00f3a volume.<\/p>\n\n\n\n<h2 id=\"Nh\u1eefng_l\u01b0u_\u00fd_quan_tr\u1ecdng_sau_khi_chuy\u1ec3n_database\"><strong>Nh\u1eefng l\u01b0u \u00fd quan tr\u1ecdng sau khi chuy\u1ec3n database<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110\u1ec3 \u0111\u1ea3m b\u1ea3o n8n ho\u1ea1t \u0111\u1ed9ng \u1ed5n \u0111\u1ecbnh, b\u1ea1n n\u00ean l\u01b0u \u00fd:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Gi\u1eef b\u1ea3n sao SQLite:<\/strong> Ch\u01b0a x\u00f3a database c\u0169 cho \u0111\u1ebfn khi x\u00e1c nh\u1eadn qu\u00e1 tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i th\u00e0nh c\u00f4ng.<\/li>\n\n\n\n<li><strong>Kh\u00f4ng ch\u1ea1y hai h\u1ec7 th\u1ed1ng c\u00f9ng x\u1eed l\u00fd workflow:<\/strong> Tr\u00e1nh k\u00edch ho\u1ea1t \u0111\u1ed3ng th\u1eddi instance c\u0169 v\u00e0 m\u1edbi \u0111\u1ec3 h\u1ea1n ch\u1ebf t\u00e1c v\u1ee5 tr\u00f9ng l\u1eb7p.<\/li>\n\n\n\n<li><strong>Gi\u1eef encryption key:<\/strong> M\u1ea5t kh\u00f3a m\u00e3 h\u00f3a c\u00f3 th\u1ec3 khi\u1ebfn credential c\u0169 kh\u00f4ng th\u1ec3 s\u1eed d\u1ee5ng.<\/li>\n\n\n\n<li><strong>Ki\u1ec3m tra d\u1eef li\u1ec7u ngo\u00e0i database:<\/strong> C\u00e1c t\u1ec7p nh\u1ecb ph\u00e2n, custom nodes ho\u1eb7c d\u1eef li\u1ec7u l\u01b0u tr\u00ean d\u1ecbch v\u1ee5 ngo\u00e0i c\u1ea7n \u0111\u01b0\u1ee3c x\u1eed l\u00fd ri\u00eang.<\/li>\n\n\n\n<li><strong>Thi\u1ebft l\u1eadp sao l\u01b0u PostgreSQL:<\/strong> Sau khi chuy\u1ec3n \u0111\u1ed5i, n\u00ean x\u00e2y d\u1ef1ng l\u1ecbch backup database b\u1eb1ng c\u00f4ng c\u1ee5 PostgreSQL ph\u00f9 h\u1ee3p.<\/li>\n\n\n\n<li><strong>Kh\u00f4ng s\u1eed d\u1ee5ng<\/strong> <strong>docker compose down -v<\/strong><strong>:<\/strong> T\u00f9y ch\u1ecdn -v c\u00f3 th\u1ec3 x\u00f3a c\u00e1c named volume c\u1ee7a d\u1ef1 \u00e1n, bao g\u1ed3m d\u1eef li\u1ec7u c\u1ea7n b\u1ea3o to\u00e0n.<\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-3.png\" alt=\"Nh\u1eefng l\u01b0u \u00fd quan tr\u1ecdng sau khi chuy\u1ec3n database\" class=\"wp-image-130660\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-3.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-3-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>Nh\u1eefng l\u01b0u \u00fd quan tr\u1ecdng sau khi chuy\u1ec3n database<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"C\u00f3_th\u1ec3_chuy\u1ec3n_to\u00e0n_b\u1ed9_d\u1eef_li\u1ec7u_SQLite_sang_PostgreSQL_kh\u00f4ng?\"><strong>C\u00f3 th\u1ec3 chuy\u1ec3n to\u00e0n b\u1ed9 d\u1eef li\u1ec7u SQLite sang PostgreSQL kh\u00f4ng?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">n8n c\u00f3 cung c\u1ea5p c\u00e1c l\u1ec7nh export:entities v\u00e0 import:entities nh\u1eb1m xu\u1ea5t, nh\u1eadp nhi\u1ec1u lo\u1ea1i d\u1eef li\u1ec7u database, bao g\u1ed3m tr\u01b0\u1eddng h\u1ee3p chuy\u1ec3n gi\u1eefa SQLite v\u00e0 PostgreSQL.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Tuy nhi\u00ean, ph\u01b0\u01a1ng ph\u00e1p n\u00e0y y\u00eau c\u1ea7u ki\u1ec3m tra k\u1ef9 t\u00ednh t\u01b0\u01a1ng th\u00edch c\u1ee7a phi\u00ean b\u1ea3n, c\u1ea5u tr\u00fac database v\u00e0 tr\u1ea1ng th\u00e1i migration. M\u1ed9t s\u1ed1 phi\u00ean b\u1ea3n \u0111\u00e3 \u0111\u01b0\u1ee3c b\u00e1o c\u00e1o g\u1eb7p l\u1ed7i kh\u00e1c bi\u1ec7t migration ID ho\u1eb7c thi\u1ebfu b\u1ea3ng d\u1eef li\u1ec7u sau khi nh\u1eadp.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">V\u00ec v\u1eady, n\u1ebfu h\u1ec7 th\u1ed1ng c\u00f3 nhi\u1ec1u ng\u01b0\u1eddi d\u00f9ng, project, ph\u00e2n quy\u1ec1n ho\u1eb7c d\u1eef li\u1ec7u l\u1ecbch s\u1eed quan tr\u1ecdng, b\u1ea1n n\u00ean th\u1eed chuy\u1ec3n to\u00e0n b\u1ed9 database trong m\u00f4i tr\u01b0\u1eddng ri\u00eang tr\u01b0\u1edbc khi \u00e1p d\u1ee5ng tr\u00ean VPS \u0111ang ho\u1ea1t \u0111\u1ed9ng.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"700\" height=\"375\" src=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-4.png\" alt=\"C\u00f3 th\u1ec3 chuy\u1ec3n to\u00e0n b\u1ed9 d\u1eef li\u1ec7u SQLite sang PostgreSQL kh\u00f4ng?\" class=\"wp-image-130661\" title=\"\" srcset=\"https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-4.png 700w, https:\/\/tino.vn\/blog\/wp-content\/uploads\/2026\/10\/doi-database-n8n-tu-sqlite-sang-postgresql-4-300x161.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><figcaption class=\"wp-element-caption\"><strong>C\u00f3 th\u1ec3 chuy\u1ec3n to\u00e0n b\u1ed9 d\u1eef li\u1ec7u SQLite sang PostgreSQL kh\u00f4ng?<\/strong><\/figcaption><\/figure>\n<\/div>\n\n\n<h2 id=\"C\u00f3_th\u1ec3_quay_l\u1ea1i_SQLite_kh\u00f4ng?\"><strong>C\u00f3 th\u1ec3 quay l\u1ea1i SQLite kh\u00f4ng?<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">C\u00f3. N\u1ebfu ch\u01b0a x\u00f3a database v\u00e0 volume c\u0169, b\u1ea1n c\u00f3 th\u1ec3 d\u1eebng n8n, kh\u00f4i ph\u1ee5c c\u1ea5u h\u00ecnh Docker Compose v\u00e0 c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng SQLite tr\u01b0\u1edbc \u0111\u00f3, r\u1ed3i kh\u1edfi \u0111\u1ed9ng l\u1ea1i v\u1edbi d\u1eef li\u1ec7u \u0111\u00e3 sao l\u01b0u.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">C\u1ea7n l\u01b0u \u00fd r\u1eb1ng d\u1eef li\u1ec7u m\u1edbi t\u1ea1o tr\u00ean PostgreSQL sau th\u1eddi \u0111i\u1ec3m chuy\u1ec3n \u0111\u1ed5i s\u1ebd kh\u00f4ng t\u1ef1 \u0111\u1ed9ng xu\u1ea5t hi\u1ec7n trong SQLite khi quay l\u1ea1i.<\/p>\n\n\n\n<h2 id=\"K\u1ebft_lu\u1eadn\"><strong>K\u1ebft lu\u1eadn<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u0110\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL<\/strong> l\u00e0 l\u1ef1a ch\u1ecdn \u0111\u00e1ng c\u00e2n nh\u1eafc khi mu\u1ed1n v\u1eadn h\u00e0nh c\u00e1c workflow t\u1ef1 \u0111\u1ed9ng h\u00f3a l\u00e2u d\u00e0i tr\u00ean VPS. Ph\u01b0\u01a1ng ph\u00e1p s\u1eed d\u1ee5ng Docker Compose v\u00e0 Server CLI gi\u00fap chuy\u1ec3n workflow, credential m\u00e0 kh\u00f4ng c\u1ea7n x\u00e2y d\u1ef1ng l\u1ea1i t\u1eeb \u0111\u1ea7u.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u0110i\u1ec1u quan tr\u1ecdng nh\u1ea5t l\u00e0 sao l\u01b0u d\u1eef li\u1ec7u tr\u01b0\u1edbc khi thao t\u00e1c, gi\u1eef nguy\u00ean encryption key v\u00e0 ki\u1ec3m tra t\u1eebng workflow sau khi chuy\u1ec3n \u0111\u1ed5i. V\u1edbi h\u1ec7 th\u1ed1ng \u0111ang ho\u1ea1t \u0111\u1ed9ng th\u1ef1c t\u1ebf, h\u00e3y ho\u00e0n t\u1ea5t qu\u00e1 tr\u00ecnh ki\u1ec3m th\u1eed tr\u01b0\u1edbc khi k\u00edch ho\u1ea1t l\u1ea1i c\u00e1c t\u00e1c v\u1ee5 t\u1ef1 \u0111\u1ed9ng.<\/p>\n\n\n\n<h2 id=\"Nh\u1eefng_c\u00e2u_h\u1ecfi_th\u01b0\u1eddng_g\u1eb7p\"><strong>Nh\u1eefng c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p<\/strong><\/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=\"\u0110\u1ed5i_database_n8n_t\u1eeb_SQLite_sang_PostgreSQL_c\u00f3_m\u1ea5t_workflow_kh\u00f4ng?\">\u0110\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL c\u00f3 m\u1ea5t workflow 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 nh\u1ea5t thi\u1ebft. N\u1ebfu xu\u1ea5t workflow th\u00e0nh c\u00f4ng v\u00e0 nh\u1eadp l\u1ea1i \u0111\u00fang c\u00e1ch, b\u1ea1n c\u00f3 th\u1ec3 gi\u1eef c\u00e1c quy tr\u00ecnh t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u0169. Tuy nhi\u00ean, ch\u1ec9 thay \u0111\u1ed5i DB_TYPE s\u1ebd kh\u00f4ng t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n d\u1eef li\u1ec7u. H\u00e3y sao l\u01b0u \u0111\u1ea7y \u0111\u1ee7 tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n.<\/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=\"URL_webhook_c\u00f3_thay_\u0111\u1ed5i_sau_khi_chuy\u1ec3n_database_kh\u00f4ng?\">URL webhook c\u00f3 thay \u0111\u1ed5i sau khi chuy\u1ec3n database 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\u1ebfu domain v\u00e0 bi\u1ebfn WEBHOOK_URL gi\u1eef nguy\u00ean. Production webhook URL \u0111\u01b0\u1ee3c t\u1ea1o t\u1eeb WEBHOOK_URL v\u00e0 \u0111\u01b0\u1eddng d\u1eabn (path) c\u1ea5u h\u00ecnh trong node Webhook, c\u1ea3 hai \u0111\u1ec1u kh\u00f4ng ph\u1ee5 thu\u1ed9c lo\u1ea1i database. Ch\u1ec9 c\u1ea7n k\u00edch ho\u1ea1t l\u1ea1i workflow l\u00e0 c\u00e1c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i g\u1ecdi t\u1edbi nh\u01b0 c\u0169.<\/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_c\u1ea7n_c\u00e0i_PostgreSQL_tr\u1ef1c_ti\u1ebfp_tr\u00ean_VPS_kh\u00f4ng?\">C\u00f3 c\u1ea7n c\u00e0i PostgreSQL tr\u1ef1c ti\u1ebfp tr\u00ean VPS 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 b\u1eaft bu\u1ed9c. N\u1ebfu \u0111ang ch\u1ea1y n8n b\u1eb1ng Docker Compose, b\u1ea1n c\u00f3 th\u1ec3 tri\u1ec3n khai PostgreSQL d\u01b0\u1edbi d\u1ea1ng m\u1ed9t container ri\u00eang. Hai service s\u1ebd k\u1ebft n\u1ed1i th\u00f4ng qua m\u1ea1ng Docker Compose m\u00e0 kh\u00f4ng c\u1ea7n c\u00e0i PostgreSQL tr\u1ef1c ti\u1ebfp l\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh VPS.<\/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=\"Sau_khi_chuy\u1ec3n_PostgreSQL,_credential_n8n_c\u00f3_c\u00f2n_ho\u1ea1t_\u0111\u1ed9ng_kh\u00f4ng?\">Sau khi chuy\u1ec3n PostgreSQL, credential n8n c\u00f3 c\u00f2n ho\u1ea1t \u0111\u1ed9ng 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\">C\u00f3 th\u1ec3 ti\u1ebfp t\u1ee5c s\u1eed d\u1ee5ng n\u1ebfu credential \u0111\u01b0\u1ee3c nh\u1eadp th\u00e0nh c\u00f4ng v\u00e0 n8n c\u00f3 \u0111\u00fang encryption key ban \u0111\u1ea7u. M\u1ed9t s\u1ed1 k\u1ebft n\u1ed1i OAuth ho\u1eb7c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i v\u1eabn c\u00f3 th\u1ec3 y\u00eau c\u1ea7u x\u00e1c th\u1ef1c l\u1ea1i, \u0111\u1eb7c bi\u1ec7t khi URL ho\u1eb7c c\u1ea5u h\u00ecnh h\u1ec7 th\u1ed1ng thay \u0111\u1ed5i.<\/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_th\u1ec3_chuy\u1ec3n_database_n8n_m\u00e0_kh\u00f4ng_d\u00f9ng_Docker_kh\u00f4ng?\">C\u00f3 th\u1ec3 chuy\u1ec3n database n8n m\u00e0 kh\u00f4ng d\u00f9ng Docker 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\">C\u00f3. N\u1ebfu c\u00e0i n8n b\u1eb1ng npm, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng Server CLI \u0111\u1ec3 xu\u1ea5t d\u1eef li\u1ec7u, c\u1ea5u h\u00ecnh c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PostgreSQL v\u00e0 nh\u1eadp l\u1ea1i d\u1eef li\u1ec7u. Quy tr\u00ecnh t\u1ed5ng th\u1ec3 t\u01b0\u01a1ng t\u1ef1 nh\u01b0ng c\u00e1ch ch\u1ea1y l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd d\u1ecbch v\u1ee5 s\u1ebd kh\u00e1c v\u1edbi Docker Compose.<\/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\": \"\u0110\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL c\u00f3 m\u1ea5t workflow 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 nh\u1ea5t thi\u1ebft. N\u1ebfu xu\u1ea5t workflow th\u00e0nh c\u00f4ng v\u00e0 nh\u1eadp l\u1ea1i \u0111\u00fang c\u00e1ch, b\u1ea1n c\u00f3 th\u1ec3 gi\u1eef c\u00e1c quy tr\u00ecnh t\u1ef1 \u0111\u1ed9ng h\u00f3a c\u0169. Tuy nhi\u00ean, ch\u1ec9 thay \u0111\u1ed5i DB_TYPE s\u1ebd kh\u00f4ng t\u1ef1 \u0111\u1ed9ng chuy\u1ec3n d\u1eef li\u1ec7u. H\u00e3y sao l\u01b0u \u0111\u1ea7y \u0111\u1ee7 tr\u01b0\u1edbc khi th\u1ef1c hi\u1ec7n.<\/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\": \"URL webhook c\u00f3 thay \u0111\u1ed5i sau khi chuy\u1ec3n database 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\u1ebfu domain v\u00e0 bi\u1ebfn WEBHOOK_URL gi\u1eef nguy\u00ean. Production webhook URL \u0111\u01b0\u1ee3c t\u1ea1o t\u1eeb WEBHOOK_URL v\u00e0 \u0111\u01b0\u1eddng d\u1eabn (path) c\u1ea5u h\u00ecnh trong node Webhook, c\u1ea3 hai \u0111\u1ec1u kh\u00f4ng ph\u1ee5 thu\u1ed9c lo\u1ea1i database. Ch\u1ec9 c\u1ea7n k\u00edch ho\u1ea1t l\u1ea1i workflow l\u00e0 c\u00e1c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i g\u1ecdi t\u1edbi nh\u01b0 c\u0169.<\/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 c\u1ea7n c\u00e0i PostgreSQL tr\u1ef1c ti\u1ebfp tr\u00ean VPS 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 b\u1eaft bu\u1ed9c. N\u1ebfu \u0111ang ch\u1ea1y n8n b\u1eb1ng Docker Compose, b\u1ea1n c\u00f3 th\u1ec3 tri\u1ec3n khai PostgreSQL d\u01b0\u1edbi d\u1ea1ng m\u1ed9t container ri\u00eang. Hai service s\u1ebd k\u1ebft n\u1ed1i th\u00f4ng qua m\u1ea1ng Docker Compose m\u00e0 kh\u00f4ng c\u1ea7n c\u00e0i PostgreSQL tr\u1ef1c ti\u1ebfp l\u00ean h\u1ec7 \u0111i\u1ec1u h\u00e0nh VPS.<\/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\": \"Sau khi chuy\u1ec3n PostgreSQL, credential n8n c\u00f3 c\u00f2n ho\u1ea1t \u0111\u1ed9ng kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3 th\u1ec3 ti\u1ebfp t\u1ee5c s\u1eed d\u1ee5ng n\u1ebfu credential \u0111\u01b0\u1ee3c nh\u1eadp th\u00e0nh c\u00f4ng v\u00e0 n8n c\u00f3 \u0111\u00fang encryption key ban \u0111\u1ea7u. M\u1ed9t s\u1ed1 k\u1ebft n\u1ed1i OAuth ho\u1eb7c d\u1ecbch v\u1ee5 b\u00ean ngo\u00e0i v\u1eabn c\u00f3 th\u1ec3 y\u00eau c\u1ea7u x\u00e1c th\u1ef1c l\u1ea1i, \u0111\u1eb7c bi\u1ec7t khi URL ho\u1eb7c c\u1ea5u h\u00ecnh h\u1ec7 th\u1ed1ng thay \u0111\u1ed5i.<\/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 th\u1ec3 chuy\u1ec3n database n8n m\u00e0 kh\u00f4ng d\u00f9ng Docker kh\u00f4ng?\",\n\t\t\t\t\"acceptedAnswer\": {\n\t\t\t\t\t\"@type\": \"Answer\",\n\t\t\t\t\t\"text\": \"<p>C\u00f3. N\u1ebfu c\u00e0i n8n b\u1eb1ng npm, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng Server CLI \u0111\u1ec3 xu\u1ea5t d\u1eef li\u1ec7u, c\u1ea5u h\u00ecnh c\u00e1c bi\u1ebfn m\u00f4i tr\u01b0\u1eddng PostgreSQL v\u00e0 nh\u1eadp l\u1ea1i d\u1eef li\u1ec7u. Quy tr\u00ecnh t\u1ed5ng th\u1ec3 t\u01b0\u01a1ng t\u1ef1 nh\u01b0ng c\u00e1ch ch\u1ea1y l\u1ec7nh v\u00e0 qu\u1ea3n l\u00fd d\u1ecbch v\u1ee5 s\u1ebd kh\u00e1c v\u1edbi Docker Compose.<\/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>\u0110\u1ec3 \u0111\u1ed5i database n8n t\u1eeb SQLite sang PostgreSQL, b\u1ea1n c\u1ea7n sao l\u01b0u d\u1eef li\u1ec7u hi\u1ec7n t\u1ea1i, c\u1ea5u h\u00ecnh PostgreSQL trong Docker Compose, sau \u0111\u00f3 chuy\u1ec3n workflow v\u00e0 credential sang database m\u1edbi. Qu\u00e1 tr\u00ecnh n\u00e0y gi\u00fap n8n s\u1eed d\u1ee5ng PostgreSQL thay cho SQLite m\u00e0 kh\u00f4ng c\u1ea7n x\u00e2y d\u1ef1ng l\u1ea1i to\u00e0n b\u1ed9 quy tr\u00ecnh t\u1ef1 \u0111\u1ed9ng h\u00f3a. [&hellip;]<\/p>\n","protected":false},"author":23,"featured_media":130662,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7397],"tags":[7343],"class_list":["post-130649","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\/130649","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=130649"}],"version-history":[{"count":4,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/130649\/revisions"}],"predecessor-version":[{"id":130664,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/posts\/130649\/revisions\/130664"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media\/130662"}],"wp:attachment":[{"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/media?parent=130649"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/categories?post=130649"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tino.vn\/blog\/wp-json\/wp\/v2\/tags?post=130649"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}