User:Jtraulle/DiscourseMigration: Difference between revisions

Jump to navigation Jump to search
m
Tag: 2017 source edit
Tag: 2017 source edit
 
(2 intermediate revisions by 2 users not shown)
Line 408: Line 408:
To download attachments from previous forum, start by export the URLs from the Kunena database.
To download attachments from previous forum, start by export the URLs from the Kunena database.


<source lang="SQL">
<syntaxhighlight lang="SQL">
SELECT CONCAT('https://www.dolibarr.fr/', folder, '/', filename) AS url FROM gvrsi_kunena_attachments ORDER BY id;
SELECT CONCAT('https://www.dolibarr.fr/', folder, '/', filename) AS url FROM gvrsi_kunena_attachments ORDER BY id;
</source>
</syntaxhighlight>


Put all the URLs into a text file (for example <code>uploads.txt</code>).
Put all the URLs into a text file (for example <code>uploads.txt</code>).
Line 416: Line 416:
Next, use <code>wget</code> to download all attachment preserving the directory structure (yuuup, file names of multiple distinct attachments can be the same ...)
Next, use <code>wget</code> to download all attachment preserving the directory structure (yuuup, file names of multiple distinct attachments can be the same ...)


<source lang="bash">
<syntaxhighlight lang="bash">
wget --no-host-directories --force-directories --input-file=uploads.txt
wget --no-host-directories --force-directories --input-file=uploads.txt
</source>
</syntaxhighlight>


===Permalinks===
===Permalinks===
Line 454: Line 454:
This code is to paste in the <code>Admin → Customize → Themes → Light → Edit CSS/HTML → Common → </head></code> section.
This code is to paste in the <code>Admin → Customize → Themes → Light → Edit CSS/HTML → Common → </head></code> section.


<source lang="HTML">
<syntaxhighlight lang="HTML">
<script type="text/javascript">
<script type="text/javascript">
var urlSplit = document.URL.split("#");
var urlSplit = document.URL.split("#");
Line 461: Line 461:
}
}
</script>
</script>
</source>
</syntaxhighlight>


===Ads===
===Ads===
Line 893: Line 893:
Note :
Note :


====Restaure Discourse backup from command line====
====Restore Discourse backup from command line====


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 927: Line 927:
''Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).''
''Useful to be able to access the database from a graphical client (like pgAdmin 4, TablePlus or Postico for example).''


1. Expose the 5432 TCP port from the container to the host by adding this line to the '''<code>expose:</code>''' section of <code>containers/app.yml</code> :
1. Expose the 5432 TCP port from the container to the host by adding this line to the '''<code>expose:</code>''' section of <code>/var/discourse/containers/app.yml</code> :
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">
  - "5432:5432"
  - "5432:5432"

Navigation menu