cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy posts to the discussion forum from one site to another in Share

kateosto
Champ in-the-making
Champ in-the-making
Hello,

I am creating a duplicate site and have successfully copied all the wiki pages and documents over. I would also like to transfer users' posts to the discussion forum from the old site to my new site. However, when I check the discussions folder in the repository for the old site, it is empty. How can I transfer users' posts to the discussion forum from one site to another?

Thanks,
Kate.
1 REPLY 1

joydeep
Champ in-the-making
Champ in-the-making
Need code to create space under /app:company_home in alfresco.

Tried below code but its not working,

void creatSpace(String childSpaceName) {
      try {

         ApplicationContext context = new ClassPathXmlApplicationContext(
               "classpath:alfresco/application-context.xml");
   
         Repository repository = (Repository) context
               .getBean("JCR.Repository");

         Session session = repository.login(new SimpleCredentials("admin",
               "jupiter".toCharArray()));

         try {

            ServiceRegistry serviceRegistry = (ServiceRegistry) context
                  .getBean("ServiceRegistry");

            Node rootNode = session.getRootNode();
            Node companyHome = rootNode.getNode("app:company_home");
            NodeRef companyHomeRef = JCRNodeRef.getNodeRef(companyHome);
            serviceRegistry.getFileFolderService().create(companyHomeRef,
                  childSpaceName, ContentModel.TYPE_FOLDER);
            session.save();
         } catch (Exception e) {
            System.out.println(e);
         }

         finally {
            session.logout();
            System.exit(0);
         }

      } catch (Exception e) {
         System.out.println(e);
      }
   }